Further fix files to conform with Black pylintrc

Mostly just breaking up strings and comments into new lines
Some strings dont require 'f' but keeping in for readability
with the rest of the concatinated string
This commit is contained in:
Zedifus 2022-03-23 06:16:22 +00:00
parent 2a512d7273
commit 09bba7fdb0
4 changed files with 111 additions and 98 deletions

View File

@ -417,7 +417,8 @@ class helpers_management:
self.set_backup_config(server_id=server_id, excluded_dirs=excluded_dirs) self.set_backup_config(server_id=server_id, excluded_dirs=excluded_dirs)
else: else:
logger.debug( logger.debug(
f"Not adding {dir_to_add} to excluded directories - already in the excluded directory list for server ID {server_id}" f"Not adding {dir_to_add} to excluded directories - "
f"already in the excluded directory list for server ID {server_id}"
) )
def del_excluded_backup_dir(self, server_id: int, dir_to_del: str): def del_excluded_backup_dir(self, server_id: int, dir_to_del: str):
@ -428,7 +429,8 @@ class helpers_management:
self.set_backup_config(server_id=server_id, excluded_dirs=excluded_dirs) self.set_backup_config(server_id=server_id, excluded_dirs=excluded_dirs)
else: else:
logger.debug( logger.debug(
f"Not removing {dir_to_del} from excluded directories - not in the excluded directory list for server ID {server_id}" f"Not removing {dir_to_del} from excluded directories - "
f"not in the excluded directory list for server ID {server_id}"
) )
@staticmethod @staticmethod

View File

@ -297,7 +297,8 @@ class helper_users:
else: else:
user_id = user.user_id user_id = user.user_id
# I just copied this code from get_user, it had those TODOs & comments made by mac - Lukas # I just copied this code from get_user,
# it had those TODOs & comments made by mac - Lukas
roles_query = ( roles_query = (
User_Roles.select() User_Roles.select()

View File

@ -56,10 +56,12 @@ class Translation:
translated_page = data[page] translated_page = data[page]
except KeyError: except KeyError:
logger.error( logger.error(
f"Translation File Error: page {page} does not exist for lang {language}" f"Translation File Error: page {page} "
f"does not exist for lang {language}"
) )
console.error( console.error(
f"Translation File Error: page {page} does not exist for lang {language}" f"Translation File Error: page {page} "
f"does not exist for lang {language}"
) )
return None return None
@ -68,10 +70,12 @@ class Translation:
return translated_word return translated_word
except KeyError: except KeyError:
logger.error( logger.error(
f"Translation File Error: word {word} does not exist on page {page} for lang {language}" f"Translation File Error: word {word} does not exist on page "
f"{page} for lang {language}"
) )
console.error( console.error(
f"Translation File Error: word {word} does not exist on page {page} for lang {language}" f"Translation File Error: word {word} does not exist on page "
f"{page} for lang {language}"
) )
return None return None

20
main.py
View File

@ -10,7 +10,8 @@ from app.classes.shared.helpers import helper
if helper.checkRoot(): if helper.checkRoot():
console.critical( console.critical(
"Root detected. Root/Admin access denied. Run Crafty again with non-elevated permissions." "Root detected. Root/Admin access denied. "
"Run Crafty again with non-elevated permissions."
) )
time.sleep(5) time.sleep(5)
console.critical("Crafty shutting down. Root/Admin access denied.") console.critical("Crafty shutting down. Root/Admin access denied.")
@ -103,8 +104,10 @@ if __name__ == "__main__":
if fresh_install: if fresh_install:
console.debug("Fresh install detected") console.debug("Fresh install detected")
console.warning( console.warning(
"We have detected a fresh install. Please be sure to forward Crafty's port, " f"We have detected a fresh install. Please be sure to forward "
+ f"{helper.get_setting('https_port')}, through your router/firewall if you would like to be able to access Crafty remotely." f"Crafty's port, {helper.get_setting('https_port')}, "
f"through your router/firewall if you would like to be able "
f"to access Crafty remotely."
) )
installer.default_settings() installer.default_settings()
else: else:
@ -127,10 +130,12 @@ if __name__ == "__main__":
# start stats logging # start stats logging
tasks_manager.start_stats_recording() tasks_manager.start_stats_recording()
# once the controller is up and stats are logging, we can kick off the scheduler officially # once the controller is up and stats are logging, we can kick off
# the scheduler officially
tasks_manager.start_scheduler() tasks_manager.start_scheduler()
# refresh our cache and schedule for every 12 hoursour cache refresh for serverjars.com # refresh our cache and schedule for every 12 hoursour cache refresh
# for serverjars.com
tasks_manager.serverjar_cache_refresher() tasks_manager.serverjar_cache_refresher()
logger.info("Checking Internet. This may take a minute.") logger.info("Checking Internet. This may take a minute.")
@ -138,8 +143,9 @@ if __name__ == "__main__":
if not helper.check_internet(): if not helper.check_internet():
console.warning( console.warning(
"We have detected the machine running Crafty has no connection to the internet. " "We have detected the machine running Crafty has no "
+ "Client connections to the server may be limited." "connection to the internet. Client connections to "
"the server may be limited."
) )
if not controller.check_system_user(): if not controller.check_system_user():