diff --git a/README.md b/README.md index cd83beb..10f1bab 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,8 @@ Can also take an existing Loop Habit database (exported from the application), and add the nomie exported habits and checkmarks to it. Simply put the exported Loop database in the same directory and call it `output.db`, it will not (should not™️) overwrite anything. +If there are any duplicated habits however, +it will add duplications of the existing repetitions into the database. Invoked like: `python run.py nomie-export.json`. Note, however, that -- until a packaged version is released -- you will need to have some packages in your environment. diff --git a/src/habitmove/repetitions.py b/src/habitmove/repetitions.py index 42b00f3..0d1ffa9 100644 --- a/src/habitmove/repetitions.py +++ b/src/habitmove/repetitions.py @@ -94,7 +94,8 @@ def add_to_database( (sql_id, repetition.timestamp, repetition.value), ) except sqlite3.IntegrityError: - # TODO better error handling + # FIXME better error handling + # TODO think about adapting this to allow importing into existing databases print( f"{sql_id}, {habit.name}: timestamp {datetime.fromtimestamp(repetition.timestamp/1000)} not unique, moving timestamp slightly." ) diff --git a/tests/test_habits.py b/tests/test_habits.py index a015a14..491d68e 100644 --- a/tests/test_habits.py +++ b/tests/test_habits.py @@ -37,8 +37,8 @@ def trackerlist(): def test_simple_habit_transform_from_tracker(trackerlist): - sut = trackerlist[0] - assert habits.trackers_to_habits([sut]) == [ + result = habits.trackers_to_habits([trackerlist[0]]) + assert result == [ loopdata.Habit( name="🧪 Testing", description="testtrack", @@ -51,8 +51,8 @@ def test_simple_habit_transform_from_tracker(trackerlist): def test_range_habit_transform_from_tracker(trackerlist): - sut = trackerlist[1] - assert habits.trackers_to_habits([sut]) == [ + result = habits.trackers_to_habits([trackerlist[1]]) + assert result == [ loopdata.Habit( name="🧪 Testing", description="testtrack",