src/use/use.py
def cleanup(self):
        """Bring registry and downloaded packages in sync.

        First all packages are removed that don't have a matching registry entry, then all registry entries that don't have a matching pkg.
        """

        def delete_folder(path):
            for sub in path.iterdir():
                if sub.is_dir():
                    delete_folder(sub)
                else:
                    sub.unlink()
            path.rmdir()

        for name, version, artifact_path, installation_path in self.registry.execute(
            "SELECT name, version, artifact_path, installation_path FROM distributions JOIN artifacts on distributions.id = distribution_id"
        ).fetchall():
            if not (
                _ensure_path(artifact_path).exists()
                and _ensure_path(installation_path).exists()
            ):
                self.del_entry(name, version)
        self.registry.connection.commit()
Bring registry and downloaded packages in sync.

        First all packages are removed that don't have a matching registry entry, then all registry entries that don't have a matching pkg.
        
Bring registry and downloaded packages in sync.
First all packages are removed that don't have a matching registry entry, then all registry entries that don't have a matching pkg.
Bring registry and downloaded packages in sync . First all packages are removed that don ' t have a matching registry entry then all registry entries that don ' t have a matching pkg .
def cleanup(self):
        def delete_folder(path):
            for sub in path.iterdir():
                if sub.is_dir():
                    delete_folder(sub)
                else:
                    sub.unlink()
            path.rmdir()
        for name, version, artifact_path, installation_path in self.registry.execute(
            "SELECT name, version, artifact_path, installation_path FROM distributions JOIN artifacts on distributions.id = distribution_id"
        ).fetchall():
            if not (
                _ensure_path(artifact_path).exists()
                and _ensure_path(installation_path).exists()
            ):
                self.del_entry(name, version)
        self.registry.connection.commit()
def cleanup ( self ) : def delete_folder ( path ) : for sub in path . iterdir ( ) : if sub . is_dir ( ) : delete_folder ( sub ) else : sub . unlink ( ) path . rmdir ( ) for name , version , artifact_path , installation_path in self . registry . execute ( "SELECT name, version, artifact_path, installation_path FROM distributions JOIN artifacts on distributions.id = distribution_id" ) . fetchall ( ) : if not ( _ensure_path ( artifact_path ) . exists ( ) and _ensure_path ( installation_path ) . exists ( ) ) : self . del_entry ( name , version ) self . registry . connection . commit ( )
Bring registry and downloaded packages in sync.
Bring registry and downloaded packages in sync .
"""Bring registry and downloaded packages in sync.

        First all packages are removed that don't have a matching registry entry, then all registry entries that don't have a matching pkg.
        """
self