Added whistle

This commit is contained in:
Casey 2024-07-08 15:35:35 +03:00
parent 09812256a7
commit 25f9e7bacb
Signed by: hkc
GPG Key ID: F0F6CFE11CDB0960
4 changed files with 13 additions and 4 deletions

View File

@ -103,7 +103,7 @@ class Manager:
async with ClientSession(connector=connector) as http: async with ClientSession(connector=connector) as http:
async with AsyncSimpleClient(http_session=http) as sio: async with AsyncSimpleClient(http_session=http) as sio:
await sio.connect(f"{self.base}/socket.io") await sio.connect(f"{self.base}/socket.io")
await asyncio.sleep(2 + random() * 2) await asyncio.sleep(0.4 + random() * 0.2)
while not self._shutdown and not self._queue.empty(): while not self._shutdown and not self._queue.empty():
try: try:
async with asyncio.timeout(1): async with asyncio.timeout(1):
@ -140,8 +140,11 @@ async def main():
proxies = load(fp)["proxies"] proxies = load(fp)["proxies"]
mgr = Manager() mgr = Manager()
with Image.open("./funnies/autism.png").convert("L") as im: # with Image.open("./funnies/autism.png").convert("L") as im:
mgr.canvas.paste(im, ((1000 - im.width) // 2, (1000 - im.height) // 2)) # mgr.canvas.paste(im, ((1000 - im.width) // 2, (1000 - im.height) // 2))
with Image.open("./result.png").convert("LA") as im:
mgr.canvas.paste(im, (0, 0))
reader_task = asyncio.create_task(mgr.reader(), name="Reader") reader_task = asyncio.create_task(mgr.reader(), name="Reader")
updater_task = asyncio.create_task(mgr.updater(), name="Updater") updater_task = asyncio.create_task(mgr.updater(), name="Updater")

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 20 KiB

BIN
pictures/whistle.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@ -49,7 +49,7 @@
"type": "time", "type": "time",
"x": 75, "x": 75,
"y": 100, "y": 100,
"format": "And time is: %Y-%m-%d %H:%M:%S UTC", "format": "And time is: %Y-%m-%d %H:%M:%S UTC miku-miku beeeam~",
"spf": 20, "spf": 20,
"font": "/usr/share/fonts/TTF/TerminusTTF.ttf", "font": "/usr/share/fonts/TTF/TerminusTTF.ttf",
"size": 12 "size": 12
@ -72,6 +72,12 @@
"path": "./pictures/casey_qr.png", "path": "./pictures/casey_qr.png",
"x": 10, "x": 10,
"y": 240 "y": 240
},
{
"type": "image",
"path": "./pictures/whistle.png",
"x": 500,
"y": 720
} }
] ]
} }