Refactor nomie data ingestion
This commit is contained in:
parent
0e31975cb0
commit
c5b532b618
2 changed files with 11 additions and 6 deletions
|
@ -33,3 +33,11 @@ def verify_continue(data):
|
|||
if not confirmation_question("Do you want to continue?", default_no=False):
|
||||
print("Aborted.")
|
||||
exit(0)
|
||||
|
||||
|
||||
# return the data belonging to nomie
|
||||
def get_data(file, interactive):
|
||||
nomie_data = load_file(file)
|
||||
if interactive:
|
||||
verify_continue(nomie_data)
|
||||
return nomie_data
|
||||
|
|
9
run.py
9
run.py
|
@ -22,12 +22,9 @@ def migrate(trackers, events):
|
|||
|
||||
|
||||
def main():
|
||||
# load nomie json
|
||||
nomie_data = nomie.load_file(sys.argv[1])
|
||||
nomie.verify_continue(nomie_data)
|
||||
trackers = nomie_data["trackers"]
|
||||
events = nomie_data["events"]
|
||||
migrate(trackers, events)
|
||||
file = sys.argv[1]
|
||||
data = nomie.get_data(file, True)
|
||||
migrate(data["trackers"], data["events"])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
Loading…
Reference in a new issue