1
0
Fork 0
mirror of https://github.com/YunoHost/apps.git synced 2024-09-03 20:06:07 +02:00

[mod] pep8

This commit is contained in:
Laurent Peuch 2017-01-20 11:35:49 +01:00
parent ce23a229b4
commit e73958e53b

View file

@ -11,7 +11,7 @@ import requests
from dateutil.parser import parse from dateutil.parser import parse
## Regular expression patterns # Regular expression patterns
"""GitHub repository URL.""" """GitHub repository URL."""
re_github_repo = re.compile( re_github_repo = re.compile(
@ -24,7 +24,7 @@ re_commit_author = re.compile(
) )
## Helpers # Helpers
def fail(msg, retcode=1): def fail(msg, retcode=1):
"""Show failure message and exit.""" """Show failure message and exit."""
@ -32,7 +32,7 @@ def fail(msg, retcode=1):
sys.exit(retcode) sys.exit(retcode)
## Main # Main
# Create argument parser # Create argument parser
parser = argparse.ArgumentParser(description='Process YunoHost application list.') parser = argparse.ArgumentParser(description='Process YunoHost application list.')
@ -93,7 +93,7 @@ for app, info in apps_list.items():
result_dict[app] = already_built_file[app] result_dict[app] = already_built_file[app]
continue continue
## Hosted on GitHub # Hosted on GitHub
github_repo = re_github_repo.match(app_url) github_repo = re_github_repo.match(app_url)
if github_repo: if github_repo:
owner = github_repo.group('owner') owner = github_repo.group('owner')
@ -131,7 +131,8 @@ for app, info in apps_list.items():
else: else:
commit_date = parse(info2['commit']['author']['date']) commit_date = parse(info2['commit']['author']['date'])
timestamp = int(time.mktime(commit_date.timetuple())) timestamp = int(time.mktime(commit_date.timetuple()))
## Git repository with HTTP/HTTPS (Gogs, GitLab, ...)
# Git repository with HTTP/HTTPS (Gogs, GitLab, ...)
elif app_url.startswith('http') and app_url.endswith('.git'): elif app_url.startswith('http') and app_url.endswith('.git'):
raw_url = '%s/raw/%s/manifest.json' % (app_url[:-4], app_rev) raw_url = '%s/raw/%s/manifest.json' % (app_url[:-4], app_rev)
try: try: