Add .dotenv for all constants

This commit is contained in:
2023-03-10 19:31:50 -06:00
parent 206be949a6
commit de2a6154b8
4 changed files with 19 additions and 5 deletions

3
.gitignore vendored
View File

@@ -1,2 +1,3 @@
.idea .idea
test test
.env

View File

@@ -7,6 +7,7 @@ name = "pypi"
multiping = "*" multiping = "*"
pillow = "*" pillow = "*"
websockets = "*" websockets = "*"
python-dotenv = "*"
[dev-packages] [dev-packages]

10
Pipfile.lock generated
View File

@@ -1,7 +1,7 @@
{ {
"_meta": { "_meta": {
"hash": { "hash": {
"sha256": "346704abb9344de6f71e398c67855db45e0398b35aa9fe688e19bc609df6321f" "sha256": "ccef10c99ccde2850597144b704849fcf19f79b971452ec2852a364ff77499f7"
}, },
"pipfile-spec": 6, "pipfile-spec": 6,
"requires": { "requires": {
@@ -109,6 +109,14 @@
"index": "pypi", "index": "pypi",
"version": "==9.4.0" "version": "==9.4.0"
}, },
"python-dotenv": {
"hashes": [
"sha256:a8df96034aae6d2d50a4ebe8216326c61c3eb64836776504fcca410e5937a3ba",
"sha256:f5971a9226b701070a4bf2c38c89e5a3f0d64de8debda981d1db98583009122a"
],
"index": "pypi",
"version": "==1.0.0"
},
"websockets": { "websockets": {
"hashes": [ "hashes": [
"sha256:00213676a2e46b6ebf6045bc11d0f529d9120baa6f58d122b4021ad92adabd41", "sha256:00213676a2e46b6ebf6045bc11d0f529d9120baa6f58d122b4021ad92adabd41",

10
main.py
View File

@@ -1,8 +1,10 @@
import asyncio import asyncio
import io import io
import os
from PIL import Image from PIL import Image
from websockets import connect from websockets import connect
from dotenv import load_dotenv
from differencing import get_pixel_differences from differencing import get_pixel_differences
from network import upload from network import upload
@@ -10,7 +12,9 @@ from network import upload
# Start a websocket # Start a websocket
# In the initial image load, detect all changes between the target and # In the initial image load, detect all changes between the target and
width, height = 512, 512 load_dotenv()
width, height = int(os.getenv("CANVAS_WIDTH")), int(os.getenv("CANVAS_HEIGHT"))
async def get_image(websocket): async def get_image(websocket):
@@ -21,9 +25,9 @@ async def get_image(websocket):
async def main(): async def main():
source_path = "C:\\Users\\Xevion\\Documents\\ShareX\\Screenshots\\2023-03\\firefox_c60J4nQj77.png" source_path = os.getenv("SOUCE_FILE")
async with connect("wss://v6.sys42.net/ws") as websocket: async with connect(os.getenv("WEBSOCKET_ADDRESS")) as websocket:
while True: while True:
print(websocket.messages) print(websocket.messages)