move executable check into util.py
This commit is contained in:
@@ -131,7 +131,7 @@ def main():
|
|||||||
import requests
|
import requests
|
||||||
|
|
||||||
extra = ""
|
extra = ""
|
||||||
if getattr(sys, "frozen", False):
|
if util.EXECUTABLE:
|
||||||
extra = " - Executable"
|
extra = " - Executable"
|
||||||
else:
|
else:
|
||||||
git_head = util.git_head()
|
git_head = util.git_head()
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ else:
|
|||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
if getattr(sys, "frozen", False):
|
if util.EXECUTABLE:
|
||||||
# look for config file in PyInstaller executable directory (#682)
|
# look for config file in PyInstaller executable directory (#682)
|
||||||
_default_configs.append(os.path.join(
|
_default_configs.append(os.path.join(
|
||||||
os.path.dirname(sys.executable),
|
os.path.dirname(sys.executable),
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ class Job():
|
|||||||
if version_info:
|
if version_info:
|
||||||
self.kwdict[version_info] = {
|
self.kwdict[version_info] = {
|
||||||
"version" : version.__version__,
|
"version" : version.__version__,
|
||||||
"is_executable" : getattr(sys, "frozen", False),
|
"is_executable" : util.EXECUTABLE,
|
||||||
"current_git_head": util.git_head()
|
"current_git_head": util.git_head()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -603,6 +603,7 @@ SECOND = datetime.timedelta(0, 1)
|
|||||||
WINDOWS = (os.name == "nt")
|
WINDOWS = (os.name == "nt")
|
||||||
SENTINEL = object()
|
SENTINEL = object()
|
||||||
USERAGENT = "gallery-dl/" + version.__version__
|
USERAGENT = "gallery-dl/" + version.__version__
|
||||||
|
EXECUTABLE = getattr(sys, "frozen", False)
|
||||||
SPECIAL_EXTRACTORS = {"oauth", "recursive", "test"}
|
SPECIAL_EXTRACTORS = {"oauth", "recursive", "test"}
|
||||||
GLOBALS = {
|
GLOBALS = {
|
||||||
"contains" : contains,
|
"contains" : contains,
|
||||||
|
|||||||
Reference in New Issue
Block a user