This commit is contained in:
jxxghp 2023-10-10 19:45:18 +08:00
parent 2d989d4229
commit 2f0f58783e
2 changed files with 6 additions and 7 deletions

View File

@ -68,7 +68,7 @@ def start_frontend():
nginx_path = settings.ROOT_PATH / 'nginx' / 'nginx' nginx_path = settings.ROOT_PATH / 'nginx' / 'nginx'
if Path(nginx_path).exists(): if Path(nginx_path).exists():
import subprocess import subprocess
subprocess.Popen(nginx_path) subprocess.Popen(f"./{nginx_path}", shell=True)
def stop_frontend(): def stop_frontend():

View File

@ -1,6 +1,6 @@
# -*- mode: python ; coding: utf-8 -*- # -*- mode: python ; coding: utf-8 -*-
def collect_pkg_data(package, include_py_files=False, subdir=None): def collect_pkg_data(package: str, include_py_files: bool = False, subdir: str = None):
""" """
Collect all data files from the given package. Collect all data files from the given package.
""" """
@ -27,7 +27,7 @@ def collect_pkg_data(package, include_py_files=False, subdir=None):
return data_toc return data_toc
def collect_local_submodules(package): def collect_local_submodules(package: str):
""" """
Collect all local submodules from the given package. Collect all local submodules from the given package.
""" """
@ -38,9 +38,9 @@ def collect_local_submodules(package):
# Walk through all file in the given package, looking for data files. # Walk through all file in the given package, looking for data files.
for file in package_dir.rglob('*.py'): for file in package_dir.rglob('*.py'):
if file.name == '__init__.py': if file.name == '__init__.py':
module = str(file.parent).replace(os.sep, '.') module = f"{file.parent}".replace(os.sep, '.')
else: else:
module = f"{package}.{file.parent.name}.{file.stem}" module = f"{file.parent}.{file.stem}".replace(os.sep, '.')
if module not in submodules: if module not in submodules:
submodules.append(module) submodules.append(module)
return submodules return submodules
@ -50,8 +50,7 @@ hiddenimports = [
'passlib.handlers.bcrypt', 'passlib.handlers.bcrypt',
'app.modules', 'app.modules',
'app.plugins', 'app.plugins',
] + collect_local_submodules('app.modules') \ ] + collect_local_submodules('app.modules') + collect_local_submodules('app.plugins')
+ collect_local_submodules('app.plugins')
block_cipher = None block_cipher = None