Compare commits
No commits in common. "45233bd593d93843574d157fb5b8f615a800d2fc" and "2e2a52e33eecdffe7a18f5b7dcd23b86d04e3e90" have entirely different histories.
45233bd593
...
2e2a52e33e
git_time_tracker
html_data_format
scripts
tests
|
@ -19,9 +19,7 @@ def filter_samples(
|
|||
samples: list[ActivitySample],
|
||||
sample_filter: set[str],
|
||||
) -> list[ActivitySample]:
|
||||
if not sample_filter:
|
||||
error_message = 'sample_filter must not be empty'
|
||||
raise ValueError(error_message)
|
||||
assert len(sample_filter) > 0
|
||||
return [s for s in samples if set(s.labels).intersection(sample_filter)]
|
||||
|
||||
|
||||
|
@ -85,6 +83,7 @@ def load_samples(args) -> set[ActivitySample]:
|
|||
shared_time_stamps_set |= set(
|
||||
git_repo.iterate_samples_from_git_repository(repo_path),
|
||||
)
|
||||
del repo_path
|
||||
|
||||
# CSV Files
|
||||
for csv_path in args.csv_files:
|
||||
|
@ -92,6 +91,7 @@ def load_samples(args) -> set[ActivitySample]:
|
|||
shared_time_stamps_set |= set(
|
||||
csv_file.iterate_samples_from_csv_file(csv_path),
|
||||
)
|
||||
del csv_path
|
||||
|
||||
return shared_time_stamps_set
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import datetime
|
||||
import json
|
||||
import logging
|
||||
from pathlib import Path
|
||||
|
||||
import bottle
|
||||
|
||||
from personal_data import csv_import
|
||||
|
@ -18,7 +19,7 @@ def newest_entry(csv_type: str):
|
|||
finds the newest entry based on the 'time.current' column, and returns it as JSON.
|
||||
"""
|
||||
|
||||
path = ROOT_DIRECTORY / f'{csv_type}.csv'
|
||||
path = ROOT_DIRECTORY/f'{csv_type}.csv'
|
||||
|
||||
bottle.response.content_type = 'application/json'
|
||||
|
||||
|
@ -40,10 +41,7 @@ def newest_entry(csv_type: str):
|
|||
else:
|
||||
newest = data[-1]
|
||||
|
||||
return {
|
||||
csv_import.csv_safe_value(k): csv_import.csv_safe_value(v)
|
||||
for k, v in newest.items()
|
||||
}
|
||||
return {csv_import.csv_safe_value(k):csv_import.csv_safe_value(v) for k,v in newest.items()}
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
# This file marks the scripts directory as a package.
|
|
@ -32,9 +32,9 @@ def parse_results(response) -> list[Result]:
|
|||
link = cells[0].a
|
||||
if link is None:
|
||||
continue
|
||||
simfile_id = link['href'].removeprefix('viewsimfile.php?simfileid=')
|
||||
id = link['href'].removeprefix('viewsimfile.php?simfileid=')
|
||||
levels = cells[1].get_text().strip()
|
||||
results.append(Result(title, int(simfile_id), levels))
|
||||
results.append(Result(title, int(id), levels))
|
||||
return results
|
||||
|
||||
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
# This file marks the tests directory as a package.
|
|
@ -4,7 +4,7 @@ from personal_data.fetchers.myanimelist import parse_name
|
|||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
('input_str', 'expected_group1', 'expected_group2'),
|
||||
'input_str, expected_group1, expected_group2',
|
||||
[
|
||||
('"Soundscape"', 'Soundscape', None),
|
||||
('"Soundscape (サウンドスケープ)"', 'Soundscape', 'サウンドスケープ'),
|
||||
|
|
Loading…
Reference in New Issue
Block a user