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):
|
if not confirmation_question("Do you want to continue?", default_no=False):
|
||||||
print("Aborted.")
|
print("Aborted.")
|
||||||
exit(0)
|
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():
|
def main():
|
||||||
# load nomie json
|
file = sys.argv[1]
|
||||||
nomie_data = nomie.load_file(sys.argv[1])
|
data = nomie.get_data(file, True)
|
||||||
nomie.verify_continue(nomie_data)
|
migrate(data["trackers"], data["events"])
|
||||||
trackers = nomie_data["trackers"]
|
|
||||||
events = nomie_data["events"]
|
|
||||||
migrate(trackers, events)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
Loading…
Reference in a new issue