mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
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:
parent
2a512d7273
commit
09bba7fdb0
@ -417,7 +417,8 @@ class helpers_management:
|
||||
self.set_backup_config(server_id=server_id, excluded_dirs=excluded_dirs)
|
||||
else:
|
||||
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):
|
||||
@ -428,7 +429,8 @@ class helpers_management:
|
||||
self.set_backup_config(server_id=server_id, excluded_dirs=excluded_dirs)
|
||||
else:
|
||||
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
|
||||
|
@ -297,7 +297,8 @@ class helper_users:
|
||||
else:
|
||||
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 = (
|
||||
User_Roles.select()
|
||||
|
@ -56,10 +56,12 @@ class Translation:
|
||||
translated_page = data[page]
|
||||
except KeyError:
|
||||
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(
|
||||
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
|
||||
|
||||
@ -68,10 +70,12 @@ class Translation:
|
||||
return translated_word
|
||||
except KeyError:
|
||||
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(
|
||||
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
|
||||
|
||||
|
20
main.py
20
main.py
@ -10,7 +10,8 @@ from app.classes.shared.helpers import helper
|
||||
|
||||
if helper.checkRoot():
|
||||
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)
|
||||
console.critical("Crafty shutting down. Root/Admin access denied.")
|
||||
@ -103,8 +104,10 @@ if __name__ == "__main__":
|
||||
if fresh_install:
|
||||
console.debug("Fresh install detected")
|
||||
console.warning(
|
||||
"We have detected a fresh install. Please be sure to forward Crafty's port, "
|
||||
+ f"{helper.get_setting('https_port')}, through your router/firewall if you would like to be able to access Crafty remotely."
|
||||
f"We have detected a fresh install. Please be sure to forward "
|
||||
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()
|
||||
else:
|
||||
@ -127,10 +130,12 @@ if __name__ == "__main__":
|
||||
# start stats logging
|
||||
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()
|
||||
|
||||
# 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()
|
||||
|
||||
logger.info("Checking Internet. This may take a minute.")
|
||||
@ -138,8 +143,9 @@ if __name__ == "__main__":
|
||||
|
||||
if not helper.check_internet():
|
||||
console.warning(
|
||||
"We have detected the machine running Crafty has no connection to the internet. "
|
||||
+ "Client connections to the server may be limited."
|
||||
"We have detected the machine running Crafty has no "
|
||||
"connection to the internet. Client connections to "
|
||||
"the server may be limited."
|
||||
)
|
||||
|
||||
if not controller.check_system_user():
|
||||
|
Loading…
Reference in New Issue
Block a user