Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug, non existing folder in iterdir #9

Closed
hannesdelbeke opened this issue Oct 11, 2023 · 2 comments
Closed

bug, non existing folder in iterdir #9

hannesdelbeke opened this issue Oct 11, 2023 · 2 comments

Comments

@hannesdelbeke
Copy link
Collaborator

Traceback (most recent call last):
  File "C:\Users\hanne\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\modules\plugget_qt\__init__.py", line 140, in search_packages
    packages = cmd.search(self.search_field.text())
  File "C:\Users\hanne\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\modules\plugget\commands\__init__.py", line 159, in search
    manifest_paths = _discover_manifest_paths(name=name, search_paths=search_paths)
  File "C:\Users\hanne\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\modules\plugget\commands\__init__.py", line 173, in _discover_manifest_paths
    package_dirs = [package_dir for package_dir in app_path.iterdir() if package_dir.is_dir()]
  File "C:\Users\hanne\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\modules\plugget\commands\__init__.py", line 173, in <listcomp>
    package_dirs = [package_dir for package_dir in app_path.iterdir() if package_dir.is_dir()]
  File "C:\Program Files\Blender Foundation\Blender 3.2\3.2\python\lib\pathlib.py", line 1015, in iterdir
    for name in self._accessor.listdir(self):

strange since we check if folder exists before iter

def _discover_manifest_paths(search_paths, name=None):
    """search for manifest files"""
    manifest_paths = []  # get the manifests
    for app_path in search_paths:  # iter app folders
        if not app_path.exists():
            continue
        package_dirs = [package_dir for package_dir in app_path.iterdir() if package_dir.is_dir()]
        for package_dir in package_dirs:  # iter package folders
            for manifest_path in package_dir.glob("*.json"):  # iter manifests
                source_name = package_dir.name  # this checks for manifest name, not name in package todo
                if name is None or name.lower() in source_name.lower():  # todo we search manifest file name, instead of name in the package
                    manifest_paths.append(manifest_path)
    return manifest_paths
@hannesdelbeke
Copy link
Collaborator Author

possibly related to cached local version.

@hannesdelbeke
Copy link
Collaborator Author

fixed bug in detect_app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant