mirror of
https://github.com/mustbeperfect/definitive-opensource.git
synced 2026-04-17 19:54:01 +02:00
Added custom-license and custom-homepage flag support
This commit is contained in:
@@ -11,4 +11,8 @@
|
||||
`💡` - Innovative: Projects that "invent" something new
|
||||
|
||||
### Flags
|
||||
`custom-description` - For apps whose description is not from GitHub so that the `stats_updator.py` script skips updating it
|
||||
`custom-description` - stats updator script skips updating the description
|
||||
|
||||
`custom-license` - stats updator script skips updating the license
|
||||
|
||||
`custom-homepage` - stats updator script skips updating the homepage
|
||||
@@ -29,19 +29,21 @@ def update_application_data(app):
|
||||
if response.status_code == 200:
|
||||
repo_data = response.json()
|
||||
|
||||
|
||||
app['stars'] = repo_data.get('stargazers_count', app['stars'])
|
||||
app['language'] = repo_data.get('language', app['language'])
|
||||
app['homepage_url'] = repo_data.get('homepage', app['homepage_url'])
|
||||
|
||||
if 'custom-homepage' not in app.get('flags', []):
|
||||
app['homepage_url'] = repo_data.get('homepage', app['homepage_url'])
|
||||
|
||||
if 'custom-description' not in app.get('flags', []):
|
||||
app['description'] = repo_data.get('description', app.get('description'))
|
||||
|
||||
license_data = repo_data.get('license')
|
||||
if license_data is not None:
|
||||
app['license'] = license_data.get('spdx_id', app['license'])
|
||||
else:
|
||||
app['license'] = app['license']
|
||||
if 'custom-license' not in app.get('flags', []):
|
||||
license_data = repo_data.get('license')
|
||||
if license_data is not None:
|
||||
app['license'] = license_data.get('spdx_id', app['license'])
|
||||
else:
|
||||
app['license'] = app['license']
|
||||
|
||||
app['last_commit'] = datetime.strptime(repo_data['pushed_at'], '%Y-%m-%dT%H:%M:%SZ').strftime('%m/%d/%Y')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user