From 0046f47d8803f42b3ee71e7efabd3090a92be4bf Mon Sep 17 00:00:00 2001 From: Samuel Sloniker Date: Sun, 21 Jul 2024 18:43:13 -0700 Subject: [PATCH] Format code --- navpoint/fix_path.py | 3 ++- navpoint/gui.py | 1 - navpoint/local_server.py | 7 ++++++- navpoint/run.py | 1 + 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/navpoint/fix_path.py b/navpoint/fix_path.py index be068cc..184e5ed 100644 --- a/navpoint/fix_path.py +++ b/navpoint/fix_path.py @@ -9,8 +9,9 @@ import sys import os.path + def fix_path(path): - if getattr(sys, 'frozen', False): + if getattr(sys, "frozen", False): return os.path.join(sys._MEIPASS, "files", path) else: return path diff --git a/navpoint/gui.py b/navpoint/gui.py index 5ed0bb4..4f3c428 100755 --- a/navpoint/gui.py +++ b/navpoint/gui.py @@ -24,5 +24,4 @@ def run(link): except tk.TclError: pass - window.mainloop() diff --git a/navpoint/local_server.py b/navpoint/local_server.py index 1d70c64..ddeef5a 100755 --- a/navpoint/local_server.py +++ b/navpoint/local_server.py @@ -9,9 +9,14 @@ class GetHandler(tornado.web.RequestHandler): def get(self): self.write(navpoint.content.content) + class ImageHandler(tornado.web.RequestHandler): def get(self): - self.write(base64.b64decode('iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAAAXnAAAF5wGk6LX5AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAABH1JREFUWIWl10mPVUUUB/Bf3TZCYhSjKHSrGEU04IhGhgQJuFAXTmHoOHwAJaJbJQzdIMYhxpUMfgAjNqDiQg0LB1ABA9GFAkFkQSuDQqShSdRAl4tb7716l9f4iCeppKrO8D+npnMqaJviCMzGw7gNY3BdYvbjKH7Ex/iS8E/7ts8P3EVcQxwgxjbbCeIq4tj/AzySuJJ4+gKAq22QuDytXksKw4B34iNMqTDOYAs249fU4NrUHsBMXFTR24Y5hCPtRH4Hsb8SyQBxMfGKNvSvIC5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mXA4yJb8Rt+i2yNjcQEL5ZioNOtpmW8T7P+PYXmCA7We0WT0q7Ksr+LGdl4Rporqdt+5SEtacjUTHZ31r+x6sChei82ze9rTOusgNfovqbtCPZmvGuy/vGsP6rQWKpSrYEUs9n8euXyVWrwhjKdYhgMFPKo87semlbj5kz7CL5uAb41lHe/JnhL5kyOcWXWHyjkSozLDGzP5u+2zvhs/JTyENbB8XR9tMEE3JUFsC2TnZj1DxSaD8WD9d5PtmfOBYXXGr7pD2Xe70JXYGYoy7KShryhsdSH7PVdhvFQ1t9ZKGu4Gs2sp95eQ2IDFPOs15ONBQ6H5hWkz3I8ns282siQ8UrNB3hTgc9xIk10YEGGsFb5nCZ9vfps1OcmVdpggj4fKtNvjXb50zvZeKFGtTSALbVktDoDPombCH+kiMYpc3jrZBQE0UTlk52f8EM6TDW3VrbFMfhZIxm9TXi+5kBnYtbS8QZ019Pxe67TYZMy47VDu3R4PAMPyeacxB9MQR6tvdGH8VZmYJ58KZ/Uj2mCFzRf2yodEi30p+kNcJQV0Zxs/CbhKOeWZF9Qf4KjMnWuaCrJehUmmSqYKqb3P+gX7bDbjhYlWU8Kpob1Le4n/N0igJZF6fpUTFwgxTHEjRVbB9NZOK9iq7L8JHFpukb/pT+6rAHjqRbgt1elz/cx+YCmjAhnla/eZ9iDY2l+tDKtP6S85x0VvW+VH5Oj/x1Aw4mR6Vs1+D++ZqfSagz7NWvHkbHKj+aJCwA+QXy7jf0ebgtaOnIxZuER3IsbcLnytgzgAHYqn/av2v2e/wswdwMLA6HnqwAAAABJRU5ErkJggg==" + ) + ) async def main(): diff --git a/navpoint/run.py b/navpoint/run.py index 0415aa2..3355443 100755 --- a/navpoint/run.py +++ b/navpoint/run.py @@ -2,6 +2,7 @@ import navpoint.local_server import navpoint.phone_server import navpoint.gui + def run(): navpoint.local_server.run() link = navpoint.phone_server.run()