in assets/__init__.py [0:0]
def get_remote_assets(package, repo):
"""
Retrieve the list of a package's remote assets.
:param package: name and version of the package, ex. 'endpoint/8.3.0'
:param repo: repository object searched for the assets
:return: generator yielding the remote assets entries
"""
from github import GithubException
for branch in branches:
try:
entries = repo.get_contents(package, ref=branch)
except GithubException:
continue
while entries:
entry = entries.pop(0)
if entry.type == "dir":
entries += repo.get_contents(entry.path, ref=branch)
else:
yield entry
return
raise ValueError(f"Package not found: {package}")