mirror of
https://github.com/zoriya/AnonymousGoose.git
synced 2026-05-27 12:14:06 +00:00
Otis ne s'arrete plus
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 699 KiB |
@@ -56,8 +56,8 @@ class AnonymousGoose:
|
||||
|
||||
if __name__ == "__main__":
|
||||
disable_x = len(sys.argv) == 2 and sys.argv[1] == '-x'
|
||||
|
||||
intro()
|
||||
goose = AnonymousGoose()
|
||||
goose.run(disable_x)
|
||||
goose.stop()
|
||||
sys.exit(0)
|
||||
|
||||
@@ -35,12 +35,14 @@ class Trick(ABC):
|
||||
from tricks.reflection import ReflectionTrick
|
||||
from tricks.rotation import RotationTrick
|
||||
from tricks.random_message import RandomMessage
|
||||
from tricks.otis_notification import Otis
|
||||
|
||||
tricks = [
|
||||
GlorifyGooseTrick,
|
||||
AnimAsciiTrick,
|
||||
LaughingGooseTrick,
|
||||
RandomMessage
|
||||
RandomMessage,
|
||||
Otis
|
||||
]
|
||||
x_tricks = [
|
||||
ReflectionTrick,
|
||||
|
||||
+14
-13
@@ -6,19 +6,20 @@ import time
|
||||
import threading
|
||||
|
||||
|
||||
def print_anim(terminal):
|
||||
is_open = True
|
||||
musicobj = sa.WaveObject.from_wave_file("data/nian_gooz.wav")
|
||||
playobj = musicobj.play()
|
||||
terminal.print("ouioui")
|
||||
while is_open:
|
||||
for frame in nian:
|
||||
is_open = terminal.print(frame)
|
||||
time.sleep(.2)
|
||||
playobj.stop()
|
||||
|
||||
|
||||
class AnimAsciiTrick(Trick):
|
||||
|
||||
@staticmethod
|
||||
def print_anim(terminal):
|
||||
is_open = True
|
||||
musicobj = sa.WaveObject.from_wave_file("data/nian_gooz.wav")
|
||||
playobj = musicobj.play()
|
||||
terminal.print("ouioui")
|
||||
while is_open:
|
||||
for frame in nian:
|
||||
is_open = terminal.print(frame)
|
||||
time.sleep(.2)
|
||||
playobj.stop()
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
return "anim"
|
||||
@@ -36,6 +37,6 @@ class AnimAsciiTrick(Trick):
|
||||
|
||||
def run(self):
|
||||
term = Term()
|
||||
thread_anim = threading.Thread(target=print_anim, args=[term])
|
||||
thread_anim = threading.Thread(target=AnimAsciiTrick.print_anim, args=[term])
|
||||
thread_anim.start()
|
||||
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
from trick import Trick
|
||||
from command_helper import CommandHelper
|
||||
import time
|
||||
import threading
|
||||
import os
|
||||
|
||||
|
||||
|
||||
|
||||
class Otis:
|
||||
|
||||
is_started = False
|
||||
|
||||
text = [
|
||||
"Mais, vous savez, moi je ne crois pas qu’il y ait de bonne ou de mauvaise situation.",
|
||||
"Moi, si je devais résumer ma vie aujourd’hui avec vous, je dirais que c’est d’abord des rencontres,",
|
||||
"des gens qui m’ont tendu la main, peut-être à un moment où je ne pouvais pas, où j’étais seul chez moi.",
|
||||
"Et c’est assez curieux de se dire que les hasards, les rencontres forgent une destinée…",
|
||||
"Parce que quand on a le goût de la chose, quand on a le goût de la chose bien faite,",
|
||||
"le beau geste, parfois on ne trouve pas l’interlocuteur en face, je dirais, le miroir qui vous aide à avancer.",
|
||||
"Alors ce n’est pas mon cas, comme je le disais là, puisque moi au contraire, j’ai pu ;",
|
||||
"et je dis merci à la vie, je lui dis merci, je chante la vie, je danse la vie… Je ne suis qu’amour !",
|
||||
"Et finalement, quand beaucoup de gens aujourd’hui me disent « Mais comment fais-tu pour avoir cette humanité ? »,",
|
||||
"eh ben je leur réponds très simplement, je leur dis que c’est ce goût de l’amour,",
|
||||
"ce goût donc qui m’a poussé aujourd’hui à entreprendre une construction mécanique,",
|
||||
"mais demain, qui sait, peut-être seulement à me mettre au service de la communauté, à faire le don, le don de soi… "
|
||||
]
|
||||
|
||||
image_path = f"{os.getcwd()}/data/otis_img.png"
|
||||
|
||||
@staticmethod
|
||||
def otis_func():
|
||||
Otis.is_started = True
|
||||
for citation in Otis.text:
|
||||
os.system(f"notify-send -i {Otis.image_path} -t 5000 Otis '{citation}' ")
|
||||
time.sleep(7)
|
||||
Otis.is_started = False
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
return "otis"
|
||||
|
||||
@property
|
||||
def delay(self):
|
||||
if Otis.is_started:
|
||||
return 0
|
||||
return 2
|
||||
|
||||
@property
|
||||
def is_reversible(self):
|
||||
return False
|
||||
|
||||
def revert(self):
|
||||
pass
|
||||
|
||||
def run(self):
|
||||
if not Otis.is_started:
|
||||
thread_otis = threading.Thread(target=Otis.otis_func, args=[])
|
||||
thread_otis.start()
|
||||
Reference in New Issue
Block a user