Skip to content

Commit

Permalink
add date fields (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
mingness authored Oct 30, 2024
1 parent 998edc0 commit 3ccd5c0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions scripts/add_new_contribution_to_yaml.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
given properties, add a new contribution to the contributions.yaml database file.
"""
from datetime import datetime
import json
from sys import argv

Expand Down Expand Up @@ -37,9 +38,11 @@

# append new contribution with next index
# add status, at top
datetime_today = datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%S%z')
contribution = {
'id': max_index + 1,
'status': 'VALID',
'date_added': datetime_today,
}
contribution.update(props)

Expand Down
5 changes: 4 additions & 1 deletion scripts/fetch_updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@


def update_contribution(contribution, props):
datetime_today = datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%S%z')
contribution['last_updated'] = datetime_today

# update from online
for field in props.keys():
# process category list
Expand All @@ -31,7 +34,7 @@ def log_broken(contribution, msg):
contribution['log'].append(msg)

def process_contribution(contribution):
date_today = datetime.today().strftime('%Y-%m-%d')
date_today = datetime.utcnow().strftime('%Y-%m-%d')
this_version = '0'

if contribution['status'] != 'DEPRECATED':
Expand Down

0 comments on commit 3ccd5c0

Please sign in to comment.