summaryrefslogtreecommitdiff
path: root/browser/util.py
diff options
context:
space:
mode:
authorMatt Singleton <matt@xcolour.net>2022-01-19 19:03:01 -0600
committerMatt Singleton <matt@xcolour.net>2022-01-19 19:03:01 -0600
commit616371e01fa96653bd43f4384a6b8ef68b3661b5 (patch)
treef156998b6de2ad66ef72423a309f8df99140892b /browser/util.py
parent35a197f5e5263bfb0e7d41717b2153c03e50008d (diff)
get it working with pyinstaller on macos
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)