From bb8a48fd4d85ba4f8224c68aaaf9069d5d79dae2 Mon Sep 17 00:00:00 2001 From: mia Date: Wed, 4 Sep 2024 04:47:13 -0700 Subject: desktop changes --- 1_graph.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to '1_graph.py') 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) -- cgit 1.4.1