[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [tpo/translations] update scripts from master
commit 0a7edbb39afa5b611b55a0c8aa0813392e23ab68
Author: emma peel <emma.peel@xxxxxxxxxx>
Date: Sat Oct 9 10:41:26 2021 +0200
update scripts from master
---
bin/csv_to_markdown | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/bin/csv_to_markdown b/bin/csv_to_markdown
index fe0c697e..38c3a690 100755
--- a/bin/csv_to_markdown
+++ b/bin/csv_to_markdown
@@ -1,4 +1,7 @@
#!/usr/bin/python3
+#
+# expects publisher,title,date,link csv files
+# date = yyyy-mm-dd
import csv
import os
@@ -15,8 +18,7 @@ with open(csv_file, newline='') as csvfile:
re_path = re.sub(r'[^\w\s]','',row[1]).lower()
create_path = re.sub(' ','-',re_path)
title = row[1]
- date = row[2].split('/')
- pub_date = "{}-{}-{}".format(date[2], date[0], date[1])
+ pub_date = row[2]
link = row[3]
full_path = os.path.join(os.getcwd(),"content/press/{}".format(create_path))
if not os.path.exists(full_path):
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits