summaryrefslogtreecommitdiff
path: root/browser/util.py
blob: 3d504b36aa212ad6ac668effe3a8651debd53baa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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)