Format Python code with psf/black push

github-actions 2 years ago
parent f999a7d9e9
commit 3bf663778b

@ -9,7 +9,11 @@ from services.moderations_service import Moderation, ThresholdSet
MOD_DB = None
try:
print("Attempting to retrieve the General and Moderations DB")
MOD_DB = SqliteDict(EnvService.find_shared_file("main_db.sqlite"), tablename="moderations", autocommit=True)
MOD_DB = SqliteDict(
EnvService.find_shared_file("main_db.sqlite"),
tablename="moderations",
autocommit=True,
)
except Exception as e:
print("Failed to retrieve the General and Moderations DB")
raise e

@ -49,8 +49,16 @@ MOD_DB = None
GENERAL_DB = None
try:
print("Attempting to retrieve the General and Moderations DB")
MOD_DB = SqliteDict(EnvService.find_shared_file("main_db.sqlite"), tablename="moderations", autocommit=True)
GENERAL_DB = SqliteDict(EnvService.find_shared_file("main_db.sqlite"), tablename="general", autocommit=True)
MOD_DB = SqliteDict(
EnvService.find_shared_file("main_db.sqlite"),
tablename="moderations",
autocommit=True,
)
GENERAL_DB = SqliteDict(
EnvService.find_shared_file("main_db.sqlite"),
tablename="general",
autocommit=True,
)
print("Retrieved the General and Moderations DB")
except Exception as e:
print("Failed to retrieve the General and Moderations DB. The bot is terminating.")

@ -792,7 +792,7 @@ class Index_handler:
)
# Save the composed index
tree_index.save_to_disk(app_root_path()/"indexes"/user_id/name)
tree_index.save_to_disk(app_root_path() / "indexes" / user_id / name)
self.index_storage[user_id].queryable_index = tree_index
@ -822,7 +822,7 @@ class Index_handler:
name = f"composed_index_{date.today().month}_{date.today().day}.json"
# Save the composed index
simple_index.save_to_disk(app_root_path()/"indexes"/user_id/name)
simple_index.save_to_disk(app_root_path() / "indexes" / user_id / name)
self.index_storage[user_id].queryable_index = simple_index
try:

Loading…
Cancel
Save