Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_assets(self, release, short_urls, assets_filter=None):
urls = []
if 'assets' in release and release['assets']:
for asset in release['assets']:
if assets_filter:
if not re.search(assets_filter, asset['name']):
continue
else:
if asset_does_not_belong_to_machine(asset['name']):
continue
urls.append(asset['browser_download_url'])
else:
download_url = self.release_download_url(release, short_urls)
if not assets_filter or re.search(assets_filter, download_url):
urls.append(download_url)
return urls