From 3442637687ac5ea38318e48997bc1be736c787ea Mon Sep 17 00:00:00 2001 From: zsloan Date: Tue, 10 May 2022 19:22:43 +0000 Subject: Add metadata to collection export file --- wqflask/wqflask/export_traits.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/wqflask/wqflask/export_traits.py b/wqflask/wqflask/export_traits.py index 7fab1e10..0c80e9a4 100644 --- a/wqflask/wqflask/export_traits.py +++ b/wqflask/wqflask/export_traits.py @@ -29,6 +29,19 @@ def export_collection(targs): buff = io.StringIO() writer = csv.writer(buff) + + now = datetime.datetime.now() + time_str = now.strftime('%H:%M (UTC) %m/%d/%y') + + metadata_rows = [ + ["# Collection Name: " + targs['collection_name_export']], + ["# User E-mail: " + targs['user_email_export']], + ["# Time/Date: " + time_str] + ] + + for row in metadata_rows: + writer.writerow(row) + for trait in table_rows: writer.writerow([trait]) -- cgit v1.2.3