mirror of
https://github.com/Xevion/v6-place.git
synced 2025-12-05 23:16:48 -06:00
Reorganize source files into place.* dir
This commit is contained in:
12
main.py
12
main.py
@@ -8,8 +8,8 @@ import os
|
||||
|
||||
from PIL import Image
|
||||
|
||||
from client import PlaceClient
|
||||
from constants import Environment
|
||||
from place.client import PlaceClient
|
||||
from place.constants import Environment
|
||||
|
||||
|
||||
# Start a websocket
|
||||
@@ -34,9 +34,11 @@ async def main():
|
||||
client.current_target = original_image
|
||||
asyncio.create_task(client.receive())
|
||||
|
||||
# await asyncio.sleep(2)
|
||||
await client.complete(5)
|
||||
|
||||
await asyncio.sleep(0.8)
|
||||
async with client.lock():
|
||||
client.source.save("./x.png")
|
||||
client.current_target.save("./target.png")
|
||||
await client.complete(1)
|
||||
print('Complete.')
|
||||
|
||||
return
|
||||
|
||||
@@ -6,10 +6,10 @@ from typing import Optional, List, Union
|
||||
import websockets
|
||||
from PIL import Image
|
||||
|
||||
from constants import Environment
|
||||
from differencing import get_pixel_differences
|
||||
from network import upload_pixels
|
||||
from pixel_types import Pixel
|
||||
from place.constants import Environment
|
||||
from place.differencing import get_pixel_differences
|
||||
from place.network import upload_pixels
|
||||
from place.pixel_types import Pixel
|
||||
|
||||
width, height = int(os.getenv(Environment.CANVAS_HEIGHT)), int(os.getenv(Environment.CANVAS_HEIGHT))
|
||||
total_pixels = width * height
|
||||
@@ -3,8 +3,8 @@ from typing import List, Union
|
||||
|
||||
from PIL import Image
|
||||
|
||||
from constants import Environment
|
||||
from pixel_types import Pixel, AlphaPixel
|
||||
from place.constants import Environment
|
||||
from place.pixel_types import Pixel, AlphaPixel
|
||||
|
||||
|
||||
def is_pixel_equal(a: Union[Pixel, AlphaPixel], b: Union[Pixel, AlphaPixel]) -> bool:
|
||||
@@ -2,7 +2,7 @@ from typing import Generator, Any, List, Tuple
|
||||
|
||||
from multiping import multi_ping
|
||||
from progressbar import progressbar
|
||||
from pixel_types import Pixel
|
||||
from place.pixel_types import Pixel
|
||||
|
||||
# The largest possible chunk that can be given to Multiping
|
||||
maximum_chunk = (2 ** 16) - 1
|
||||
Reference in New Issue
Block a user