From a632034751f3a260ac2c7354bdf9cef5b7f0f9b5 Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Wed, 10 Mar 2021 18:44:32 -0700 Subject: [PATCH] Change statuses to ints --- server/main.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/server/main.py b/server/main.py index 489fc3d..4037a5e 100644 --- a/server/main.py +++ b/server/main.py @@ -12,7 +12,13 @@ output_folder = Path('./output') app = Flask(__name__, static_folder=str(build_folder), static_url_path='') CORS(app) -status = 'Standby' +STANDBY = 0 +WARMUP = 1 +CAPTURING = 2 +WRITING = 3 +DOWNLOADING = 4 + +status = STANDBY @app.route('/api/status', methods=['GET']) def status_get(): @@ -97,7 +103,7 @@ def session_post(cid): abort(404) # go through the photo taking process - status = 'Warming up' + status = WARMUP try: # warmup @@ -112,7 +118,7 @@ def session_post(cid): print() abort(500) - status = 'Capturing' + status = CAPTURING # capture power.lights_on() @@ -126,13 +132,13 @@ def session_post(cid): power.grid_off() power.lights_off() - status = 'Writing to files' + status = WRITING time.sleep(3) - status = 'Downloading' + status = DOWNLOADING download.download_all_photos(path) - status = 'Standby' + status = STANDBY return '' @app.route('/')