Skip to content

Commit

Permalink
black linter
Browse files Browse the repository at this point in the history
  • Loading branch information
ryansurf committed May 25, 2024
1 parent 74497e0 commit a9ea40c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/backend/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
website = bool(os.getenv("WEBSITE"))

if website == True:
print("RUNNING WEBSITE")
subprocess.Popen(["python", "-m", "http.server", "9000"], cwd="../frontend")
print("RUNNING WEBSITE")
subprocess.Popen(["python", "-m", "http.server", "9000"], cwd="../frontend")

args = helper.seperate_args(sys.argv)
# sys cli inputs
Expand Down
12 changes: 8 additions & 4 deletions src/backend/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
website = bool(os.getenv("WEBSITE"))

if website == True:
subprocess.Popen(["python", "-m", "http.server", "9000"], cwd="../frontend")
subprocess.Popen(["python", "-m", "http.server", "9000"], cwd="../frontend")


class MyHTTPRequestHandler(http.server.BaseHTTPRequestHandler):
Expand Down Expand Up @@ -43,7 +43,9 @@ def do_GET(self):
help_text = file.read()
self.send_response(200)
self.send_header("Content-type", "text/plain")
self.send_header("Access-Control-Allow-Origin", "*") # Allow requests from any origin
self.send_header(
"Access-Control-Allow-Origin", "*"
) # Allow requests from any origin
self.end_headers()
self.wfile.write(help_text.encode())
except FileNotFoundError:
Expand All @@ -52,7 +54,7 @@ def do_GET(self):
self.end_headers()
self.wfile.write(b"help.txt not found")
else:

# Otherwise, run the main.py script with the provided arguments
result = subprocess.run(
["python3", "main.py"] + args,
Expand All @@ -62,7 +64,9 @@ def do_GET(self):
)
self.send_response(200)
self.send_header("Content-type", "text/plain")
self.send_header("Access-Control-Allow-Origin", "*") # Allow requests from any origin
self.send_header(
"Access-Control-Allow-Origin", "*"
) # Allow requests from any origin
self.end_headers()
self.wfile.write(result.stdout.encode())

Expand Down

0 comments on commit a9ea40c

Please sign in to comment.