diff options
author | mia <mia@mia.jetzt> | 2024-09-04 04:47:13 -0700 |
---|---|---|
committer | mia <mia@mia.jetzt> | 2024-09-04 04:47:13 -0700 |
commit | bb8a48fd4d85ba4f8224c68aaaf9069d5d79dae2 (patch) | |
tree | bdb0654c667f37c69addc9efd1e29b9cfe710c51 /2_filter.py | |
parent | 81071e8feefdf815e29318226c668664e1706da2 (diff) | |
download | scrubber-bb8a48fd4d85ba4f8224c68aaaf9069d5d79dae2.tar.gz scrubber-bb8a48fd4d85ba4f8224c68aaaf9069d5d79dae2.zip |
desktop changes
Diffstat (limited to '2_filter.py')
-rw-r--r-- | 2_filter.py | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/2_filter.py b/2_filter.py index 816e762..8e77945 100644 --- a/2_filter.py +++ b/2_filter.py @@ -4,32 +4,14 @@ from typing import Callable, List import psycopg -from ty import FilterableNote, Visibility +from com import FilterableNote, Visibility, eval_config, parse_graph, progressbar -try: - import progressbar2 as progressbar -except ImportError: - import progressbar - -print("configuring") -config = {} -exec(Path("config.py").read_text(), config) +config = eval_config() conn: psycopg.Connection = config["connect"]() criteria: Callable[[FilterableNote], bool] = config["criteria"] -intermediate = {} - -print("parsing") -for line in Path("graph.db").read_text().splitlines(): - id, replies, quotes, flags = line.split("\t") - intermediate[id] = { - "id": id, - "replies": replies.split(",") if len(replies) > 0 else [], - "quotes": quotes.split(",") if len(quotes) > 0 else [], - "flags": flags.split(",") if len(flags) > 0 else [], - } - +intermediate = parse_graph() def transform(entry: dict) -> FilterableNote: note = conn.execute( |