mirror of https://github.com/chriskiehl/Gooey.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
770 B
20 lines
770 B
import sys
|
|
import os
|
|
|
|
|
|
def is_frozen():
|
|
return getattr(sys, 'frozen', False)
|
|
|
|
|
|
def get_resource_path(*args):
|
|
if is_frozen():
|
|
resource_dir = os.path.join(os.path.dirname(sys.executable), 'gooey')
|
|
if not os.path.isdir(resource_dir):
|
|
raise IOError(("cannot locate Gooey resources. It seems that the program "
|
|
"was frozen, but resource files were not copied to "
|
|
"directory of the executable file. Please copy "
|
|
"`languages` and `images` folders from gooey module "
|
|
"directory into `{}{}` directory.".format(resource_dir, os.sep)))
|
|
else:
|
|
resource_dir = os.path.normpath(os.path.join(os.path.dirname(__file__), '..', '..'))
|
|
return os.path.join(resource_dir, *args)
|