-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
837f871
commit f6aee14
Showing
5 changed files
with
40 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters