🗝
summary refs log tree commit diff
path: root/1_graph.py
diff options
context:
space:
mode:
authormia <mia@mia.jetzt>2024-09-04 04:47:13 -0700
committermia <mia@mia.jetzt>2024-09-04 04:47:13 -0700
commitbb8a48fd4d85ba4f8224c68aaaf9069d5d79dae2 (patch)
treebdb0654c667f37c69addc9efd1e29b9cfe710c51 /1_graph.py
parent81071e8feefdf815e29318226c668664e1706da2 (diff)
downloadscrubber-bb8a48fd4d85ba4f8224c68aaaf9069d5d79dae2.tar.gz
scrubber-bb8a48fd4d85ba4f8224c68aaaf9069d5d79dae2.zip
desktop changes
Diffstat (limited to '1_graph.py')
-rw-r--r--1_graph.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/1_graph.py b/1_graph.py
index bc8116c..824d723 100644
--- a/1_graph.py
+++ b/1_graph.py
@@ -3,24 +3,20 @@ import sys
 from collections import namedtuple
 from functools import cache
 from pathlib import Path
+from typing import Optional
 
 import psycopg
 
-try:
-    import progressbar2 as progressbar
-except ImportError:
-    import progressbar
+from com import eval_config, progressbar
 
 
 Note = namedtuple("Note", ["renote_id", "reply_id", "user_id"])
 Tree = namedtuple("Tree", ["id", "replies", "renotes"])
 
-print("configuring")
-config = {}
-exec(Path("config.py").read_text(), config)
+config = eval_config()
 conn: psycopg.Connection = config["connect"]()
 user_id: str = config["user_id"]
-early_exit = config.get("early_exit")
+early_exit: Optional[int] = config.get("early_exit")
 
 
 print("fetching note ids", file=sys.stderr)