- 优化豆瓣详情展示
This commit is contained in:
@ -8,17 +8,20 @@ def collect_pkg_data(package: str, include_py_files: bool = False, subdir: str =
|
|||||||
from PyInstaller.utils.hooks import get_package_paths, PY_IGNORE_EXTENSIONS
|
from PyInstaller.utils.hooks import get_package_paths, PY_IGNORE_EXTENSIONS
|
||||||
from PyInstaller.building.datastruct import TOC
|
from PyInstaller.building.datastruct import TOC
|
||||||
|
|
||||||
|
data_toc = TOC()
|
||||||
|
|
||||||
# Accept only strings as packages.
|
# Accept only strings as packages.
|
||||||
if type(package) is not str:
|
if type(package) is not str:
|
||||||
raise ValueError
|
raise ValueError
|
||||||
|
try:
|
||||||
pkg_base, pkg_dir = get_package_paths(package)
|
pkg_base, pkg_dir = get_package_paths(package)
|
||||||
|
except ValueError:
|
||||||
|
return data_toc
|
||||||
if subdir:
|
if subdir:
|
||||||
pkg_path = Path(pkg_dir) / subdir
|
pkg_path = Path(pkg_dir) / subdir
|
||||||
else:
|
else:
|
||||||
pkg_path = Path(pkg_dir)
|
pkg_path = Path(pkg_dir)
|
||||||
# Walk through all file in the given package, looking for data files.
|
# Walk through all file in the given package, looking for data files.
|
||||||
data_toc = TOC()
|
|
||||||
if not pkg_path.exists():
|
if not pkg_path.exists():
|
||||||
return data_toc
|
return data_toc
|
||||||
for file in pkg_path.rglob('*'):
|
for file in pkg_path.rglob('*'):
|
||||||
|
Reference in New Issue
Block a user