Skip to content

Commit 42c3dae

Browse files
committed
fix: circular import
1 parent 8114713 commit 42c3dae

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/config.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import configparser
77
import torch
88
import toml
9-
import src.log.logger as scan_log
109
from db.conn import create_table
1110

1211
def load_config_from_toml(file_path):
@@ -18,11 +17,11 @@ def load_config_from_toml(file_path):
1817
config = toml.load(file)
1918
return config
2019
except FileNotFoundError:
21-
scan_log.error(f"cannot find {file_path}")
20+
print(f"cannot find {file_path}", flush=True)
2221
except toml.TomlDecodeError as e:
23-
scan_log.error(f"cannot parse {file_path} as a valid toml file, error: {e}")
22+
print(f"cannot parse {file_path} as a valid toml file, error: {e}", flush=True)
2423
except Exception as e:
25-
scan_log.error(f"unknown error when loading config file, error: {e}")
24+
print(f"unknown error when loading config file, error: {e}", flush=True)
2625
return None
2726

2827
def get_model_path():
@@ -43,12 +42,12 @@ def get_interface_config():
4342
LOG_DIR = os.path.join(BILIVE_DIR, 'logs')
4443
VIDEOS_DIR = os.path.join(BILIVE_DIR, 'Videos')
4544
if not os.path.exists(SRC_DIR + '/db/data.db'):
46-
scan_log.info("Initialize the database")
45+
print("Initialize the database", flush=True)
4746
create_table()
4847

4948
config = load_config_from_toml(os.path.join(BILIVE_DIR, 'settings.toml'))
5049
if config is None:
51-
scan_log.error("failed to load config file, please check twice")
50+
print("failed to load config file, please check twice", flush=True)
5251
exit(1)
5352

5453
GPU_EXIST = torch.cuda.is_available()

0 commit comments

Comments
 (0)