Take file as argument
This commit is contained in:
parent
466585fe88
commit
5027c4ce46
1 changed files with 11 additions and 6 deletions
|
@ -1,8 +1,9 @@
|
||||||
import os
|
|
||||||
import csv
|
import csv
|
||||||
import re
|
|
||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
|
import os
|
||||||
|
import re
|
||||||
import requests
|
import requests
|
||||||
|
import sys
|
||||||
|
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
FORGEJO_API_TOKEN = os.getenv("FORGEJO_API_TOKEN")
|
FORGEJO_API_TOKEN = os.getenv("FORGEJO_API_TOKEN")
|
||||||
|
@ -70,9 +71,6 @@ def parse_notes_section(notes):
|
||||||
def parse_harvest_csv(file=None):
|
def parse_harvest_csv(file=None):
|
||||||
global issues_and_urls
|
global issues_and_urls
|
||||||
|
|
||||||
if file is None:
|
|
||||||
file = prompt_for_file(file)
|
|
||||||
|
|
||||||
print('Beginning parsing for issues')
|
print('Beginning parsing for issues')
|
||||||
|
|
||||||
with open(file, 'r') as f:
|
with open(file, 'r') as f:
|
||||||
|
@ -100,5 +98,12 @@ def parse_harvest_csv(file=None):
|
||||||
row_count += 1
|
row_count += 1
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
parse_harvest_csv()
|
try:
|
||||||
|
file_path = sys.argv[1]
|
||||||
|
except Exception as e:
|
||||||
|
print("No file provided, exitting")
|
||||||
|
quit()
|
||||||
|
if file_path:
|
||||||
|
check_for_file(file_path)
|
||||||
|
parse_harvest_csv(file_path)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue