Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
chatat
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
chatat
Commits
b99ca815
Kaydet (Commit)
b99ca815
authored
May 31, 2019
tarafından
Batuhan Taşkaya
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
add demo
üst
b3f8b2f1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
5 deletions
+7
-5
README.md
README.md
+1
-0
__main__.py
chatat/__main__.py
+6
-5
gui.py
chatat/gui.py
+0
-0
demo.png
demo.png
+0
-0
No files found.
README.md
Dosyayı görüntüle @
b99ca815
# Chatat
# Chatat
![
demo
](
demo.png
)
chatat/__main__.py
Dosyayı görüntüle @
b99ca815
import
asyncio
import
asyncio
import
curses
import
curses
from
io
import
StringIO
from
pubmarine
import
PubPen
from
pubmarine
import
PubPen
...
@@ -16,7 +15,7 @@ class ChatInterface:
...
@@ -16,7 +15,7 @@ class ChatInterface:
self
.
pubpen
.
subscribe
(
"message"
,
self
.
show_message
)
self
.
pubpen
.
subscribe
(
"message"
,
self
.
show_message
)
self
.
pubpen
.
subscribe
(
"new_char"
,
self
.
show_typing
)
self
.
pubpen
.
subscribe
(
"new_char"
,
self
.
show_typing
)
self
.
_buffer
=
StringIO
()
self
.
_buffer
=
""
self
.
helix
=
self
.
pubpen
.
loop
.
run_until_complete
(
self
.
helix
=
self
.
pubpen
.
loop
.
run_until_complete
(
TwitchHelixProtocol
.
session
(
auth
,
self
.
pubpen
.
loop
)
TwitchHelixProtocol
.
session
(
auth
,
self
.
pubpen
.
loop
)
...
@@ -83,7 +82,7 @@ class ChatInterface:
...
@@ -83,7 +82,7 @@ class ChatInterface:
def
show_typing
(
self
,
char
):
def
show_typing
(
self
,
char
):
if
char
==
"
\n
"
:
if
char
==
"
\n
"
:
message
=
Message
.
from_simple
(
message
=
Message
.
from_simple
(
Channel
(
"btaskaya"
),
self
.
auth
.
username
,
self
.
_buffer
.
getvalue
()
Channel
(
"btaskaya"
),
self
.
auth
.
username
,
self
.
_buffer
)
)
self
.
pubpen
.
publish
(
"send"
,
message
)
self
.
pubpen
.
publish
(
"send"
,
message
)
self
.
pubpen
.
publish
(
"message"
,
message
)
self
.
pubpen
.
publish
(
"message"
,
message
)
...
@@ -91,14 +90,14 @@ class ChatInterface:
...
@@ -91,14 +90,14 @@ class ChatInterface:
return
return
self
.
input_current_x
+=
1
self
.
input_current_x
+=
1
self
.
_buffer
.
write
(
char
)
self
.
_buffer
+=
char
self
.
input_buffer
.
addstr
(
0
,
self
.
input_current_x
-
1
,
char
.
encode
(
"utf-8"
))
self
.
input_buffer
.
addstr
(
0
,
self
.
input_current_x
-
1
,
char
.
encode
(
"utf-8"
))
self
.
input_buffer
.
refresh
()
self
.
input_buffer
.
refresh
()
def
clear_typing
(
self
):
def
clear_typing
(
self
):
self
.
input_current_x
=
0
self
.
input_current_x
=
0
self
.
input_buffer
.
clear
()
self
.
input_buffer
.
clear
()
self
.
_buffer
.
truncate
(
0
)
self
.
_buffer
=
""
self
.
input_buffer
.
refresh
()
self
.
input_buffer
.
refresh
()
...
@@ -125,3 +124,5 @@ if __name__ == "__main__":
...
@@ -125,3 +124,5 @@ if __name__ == "__main__":
task
=
loop
.
create_task
(
display
.
get_char
())
task
=
loop
.
create_task
(
display
.
get_char
())
loop
.
run_forever
()
loop
.
run_forever
()
task
.
cancel
()
task
.
cancel
()
with
suppress
(
ValueError
):
loop
.
run_until_complete
(
task
)
chatat/gui.py
deleted
100644 → 0
Dosyayı görüntüle @
b3f8b2f1
demo.png
0 → 100644
Dosyayı görüntüle @
b99ca815
67.8 KB
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment