🗝
summary refs log tree commit diff
path: root/1_graph.py
diff options
context:
space:
mode:
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)