diff --git a/obsidian_import/__init__.py b/obsidian_import/__init__.py index cb3a39f..38a3c9c 100644 --- a/obsidian_import/__init__.py +++ b/obsidian_import/__init__.py @@ -194,8 +194,9 @@ def import_activity_samples( group_category: str | None = None, default_estimated_duration: datetime.timedelta | None = None, ) -> int: - samples = heuristically_realize_samples(raw_samples, - default_estimated_duration=default_estimated_duration) + samples = heuristically_realize_samples( + raw_samples, default_estimated_duration=default_estimated_duration, + ) if group_category is not None: samples = merge_adjacent_samples(list(samples), group_category) @@ -233,6 +234,7 @@ def import_activity_samples( return num_updated + def import_activity_sample_csv( vault: ObsidianVault, rows: Rows, @@ -273,7 +275,11 @@ def import_wanikani_events(vault: ObsidianVault, rows: Rows): for row in rows: for k in keys: if k in row: - raw_samples.append(ActivitySample([Label('application.name', 'WaniKani')], None, row[k])) + raw_samples.append( + ActivitySample( + [Label('application.name', 'WaniKani')], None, row[k], + ), + ) del k del row @@ -285,9 +291,14 @@ def import_wanikani_events(vault: ObsidianVault, rows: Rows): comment='', ) - return import_activity_samples(vault, raw_samples, mapper, - group_category='application.name', - default_estimated_duration=datetime.timedelta(minutes=5)) + return import_activity_samples( + vault, + raw_samples, + mapper, + group_category='application.name', + default_estimated_duration=datetime.timedelta(minutes=5), + ) + PATH_WATCHED = Path('output/show_episodes_watched.csv') PATH_PLAYED = Path('output/games_played.csv') @@ -300,7 +311,11 @@ PATH_STEPMANIA = Path('output/stepmania.csv') IMPORTERS = [ - {'path': PATH_WANIKANI, 'standard_variant': True, 'import_rows': import_wanikani_events}, + { + 'path': PATH_WANIKANI, + 'standard_variant': True, + 'import_rows': import_wanikani_events, + }, {'path': PATH_WORKOUT, 'standard_variant': True, 'import_rows': import_workout_csv}, {'path': PATH_STEP_COUNTS, 'import_rows': import_step_counts_csv}, {