Skip to content

Commit

Permalink
revert configapp debugs
Browse files Browse the repository at this point in the history
  • Loading branch information
tavdog committed Feb 27, 2025
1 parent a701a3d commit 0489036
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions tronbyt_server/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,8 @@
import uuid
from typing import Any, Dict, Optional
from operator import itemgetter
import json
import urllib.parse
from werkzeug.utils import secure_filename


import requests
from flask import (
Blueprint,
Expand Down Expand Up @@ -587,18 +584,16 @@ def configapp(device_id: str, iname: str, delete_on_cancel: int) -> Response:
# run the in browser configure interface via pixlet serve
elif request.method == "GET":
url_params = ""
config_dict = dict()
config_dict['location'] = dict()
# if os.path.exists(config_path):
# with open(config_path, "r") as c:
# config_dict = json.load(c)

config_dict['location']['lat'] = "34.000"
config_dict['location']['lng'] = "-122.0000"
url_params = urllib.parse.urlencode(config_dict)
print(url_params)
if len(url_params) > 2:
flash(url_params)
if os.path.exists(config_path):
import json
import urllib.parse

with open(config_path, "r") as c:
config_dict = json.load(c)
url_params = urllib.parse.urlencode(config_dict)
print(url_params)
if len(url_params) > 2:
flash(url_params)

# should add the device location/timezome info to the url params here

Expand Down Expand Up @@ -767,7 +762,6 @@ def appwebp(device_id: str, iname: str) -> Response:
webp_path = "{}/{}.webp".format(
db.get_device_webp_dir(device_id), app_basename
)
print(webp_path)
webp_path = secure_filename(webp_path)
if os.path.exists(webp_path) and os.path.getsize(webp_path) > 0:
return send_file(webp_path, mimetype="image/webp")
Expand Down

0 comments on commit 0489036

Please sign in to comment.