- 优化豆瓣详情展示
This commit is contained in:
parent
699312ff28
commit
539d9cf537
@ -19,6 +19,8 @@ def collect_pkg_data(package: str, include_py_files: bool = False, subdir: str =
|
||||
pkg_path = Path(pkg_dir)
|
||||
# Walk through all file in the given package, looking for data files.
|
||||
data_toc = TOC()
|
||||
if not pkg_path.exists():
|
||||
return data_toc
|
||||
for file in pkg_path.rglob('*'):
|
||||
if file.is_file():
|
||||
extension = file.suffix
|
||||
@ -37,6 +39,8 @@ def collect_local_submodules(package: str):
|
||||
package_dir = Path(package.replace('.', os.sep))
|
||||
submodules = [package]
|
||||
# Walk through all file in the given package, looking for data files.
|
||||
if not package_dir.exists():
|
||||
return []
|
||||
for file in package_dir.rglob('*.py'):
|
||||
if file.name == '__init__.py':
|
||||
module = f"{file.parent}".replace(os.sep, '.')
|
||||
|
Loading…
x
Reference in New Issue
Block a user