summaryrefslogtreecommitdiff
path: root/browser/util.py
diff options
context:
space:
mode:
Diffstat (limited to 'browser/util.py')
-rw-r--r--browser/util.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/browser/util.py b/browser/util.py
new file mode 100644
index 0000000..3d504b3
--- /dev/null
+++ b/browser/util.py
@@ -0,0 +1,13 @@
+import os
+import sys
+
+
+def resource_path(relative_path: str) -> str:
+ # https://stackoverflow.com/a/13790741
+ try:
+ base_path = sys._MEIPASS
+ except Exception:
+ base_path = os.path.abspath(".")
+ with open('/Users/matt/devel/gemini-client/applog.txt', 'w') as fp:
+ fp.write(os.path.join(base_path, relative_path))
+ return os.path.join(base_path, relative_path)