Commit 9e640873 authored by Dimitri Podborski's avatar Dimitri Podborski
Browse files

remove -u option, its more confusing than helpful

parent 1f039a9f
......@@ -106,7 +106,7 @@ def is_document_late(meeting_start, v1_upload_timestamp):
meeting_start and v1_upload_timestamp shall be datetime objects
"""
meeting_start = meeting_start.replace(hour=0, minute=0, second=0) # paranoia
deadline = meeting_start - timedelta(days=7) # End of Sunday
deadline = meeting_start - timedelta(days=4) # End of Wed
diff = deadline - v1_upload_timestamp
if diff.total_seconds() <= 0:
return True
......@@ -117,7 +117,7 @@ def try_parsing_date(text):
"""
Try parsing the timestamp, if not possible return None
"""
for fmt in ('%Y-%m-%d %H:%M:%S', 'Y-%m-%d'):
for fmt in ('%Y-%m-%d %H:%M:%S', '%Y-%m-%d'):
try:
return datetime.strptime(text.strip(), fmt)
except ValueError:
......
......@@ -92,7 +92,7 @@ class MDMSParser:
"""
Try parsing the timestamp, if not possible return None
"""
for fmt in ('%Y-%m-%d %H:%M:%S', 'Y-%m-%d'):
for fmt in ('%Y-%m-%d %H:%M:%S', '%Y-%m-%d'):
try:
return datetime.strptime(text.strip(), fmt)
except ValueError:
......
......@@ -375,7 +375,6 @@ def main():
parser.add_argument('-d', '--docx', help='Mode: Generate output word document.', action='store_true')
parser.add_argument('-l', '--list', help='Mode: List information about the contribution(s).', action='store_true')
parser.add_argument('-C', '--CLOSE', help='Force closing GitLab issues.', action='store_true')
parser.add_argument('-u', '--update', help='Update MDMS documents database.', action='store_true')
parser.add_argument('-U', '--UPDATE', help='Update all databases.', action='store_true')
parser.add_argument('-i', '--csv', help='Input CSV file. Header row shall include "Number" and ("Project URL" or '
'"Sub Group" and "Project Name").')
......@@ -431,14 +430,12 @@ def main():
meeting['end_date']))
# get input documents (and update if needed)
input_docs_path = os.path.join(DATA_PATH, 'input_docs_{}.json'.format(meeting['number']))
if not os.path.isfile(input_docs_path) or args.UPDATE or args.update:
print(' * Update MPEG input documents data for MPEG#', meeting['number'])
input_docs = mdms.get_input_documents(meeting['id'])
if len(input_docs) == 0:
print(' * ERROR, could not get input documents from MDMS. Check your password.')
sys.exit(1)
helpers.store_json_data(input_docs_path, input_docs)
input_docs = helpers.load_json_data(input_docs_path)
print(' * Update MPEG input documents data for MPEG#', meeting['number'])
input_docs = mdms.get_input_documents(meeting['id'])
if len(input_docs) == 0:
print(' * ERROR, could not get input documents from MDMS. Check your password.')
sys.exit(1)
helpers.store_json_data(input_docs_path, input_docs)
output_path = 'output.docx'
table_entries = []
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment