mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Merge branch 'bugfix/lint-corrections' into 'dev'
Bugfix/lint corrections See merge request crafty-controller/crafty-commander!233
This commit is contained in:
commit
505f06825a
@ -322,8 +322,11 @@ class helpers_management:
|
||||
|
||||
@staticmethod
|
||||
def get_schedules_enabled():
|
||||
# pylint: disable=singleton-comparison
|
||||
return Schedules.select().where(Schedules.enabled == True).execute()
|
||||
return (
|
||||
Schedules.select()
|
||||
.where(Schedules.enabled == True) # pylint: disable=singleton-comparison
|
||||
.execute()
|
||||
)
|
||||
|
||||
# **********************************************************************************
|
||||
# Backups Methods
|
||||
@ -435,12 +438,9 @@ class helpers_management:
|
||||
|
||||
@staticmethod
|
||||
def clear_unexecuted_commands():
|
||||
Commands.update(
|
||||
{
|
||||
Commands.executed: True
|
||||
# pylint: disable=singleton-comparison
|
||||
}
|
||||
).where(Commands.executed == False).execute()
|
||||
Commands.update({Commands.executed: True}).where(
|
||||
Commands.executed == False # pylint: disable=singleton-comparison
|
||||
).execute()
|
||||
|
||||
|
||||
management_helper = helpers_management()
|
||||
|
@ -227,8 +227,9 @@ class Permissions_Servers:
|
||||
def get_server_user_list(server_id):
|
||||
final_users = []
|
||||
server_roles = Role_Servers.select().where(Role_Servers.server_id == server_id)
|
||||
# pylint: disable=singleton-comparison
|
||||
super_users = Users.select().where(Users.superuser == True)
|
||||
super_users = Users.select().where(
|
||||
Users.superuser == True # pylint: disable=singleton-comparison
|
||||
)
|
||||
for role in server_roles:
|
||||
users = User_Roles.select().where(User_Roles.role_id == role.role_id)
|
||||
for user in users:
|
||||
|
@ -260,8 +260,7 @@ class helper_servers:
|
||||
@staticmethod
|
||||
def is_crashed(server_id):
|
||||
svr = Server_Stats.select().where(Server_Stats.server_id == server_id).get()
|
||||
# pylint: disable=singleton-comparison
|
||||
if svr.crashed == True:
|
||||
if svr.crashed is True:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
@ -221,8 +221,9 @@ class helper_users:
|
||||
@staticmethod
|
||||
def get_super_user_list():
|
||||
final_users = []
|
||||
# pylint: disable=singleton-comparison
|
||||
super_users = Users.select().where(Users.superuser == True)
|
||||
super_users = Users.select().where(
|
||||
Users.superuser == True # pylint: disable=singleton-comparison
|
||||
)
|
||||
for suser in super_users:
|
||||
if suser.user_id not in final_users:
|
||||
final_users.append(suser.user_id)
|
||||
@ -251,8 +252,9 @@ class helper_users:
|
||||
|
||||
@staticmethod
|
||||
def clear_support_status():
|
||||
# pylint: disable=singleton-comparison
|
||||
Users.update(preparing=False).where(Users.preparing == True).execute()
|
||||
Users.update(preparing=False).where(
|
||||
Users.preparing == True # pylint: disable=singleton-comparison
|
||||
).execute()
|
||||
|
||||
@staticmethod
|
||||
def user_id_exists(user_id):
|
||||
|
@ -21,12 +21,12 @@ class MainPrompt(cmd.Cmd):
|
||||
# overrides the default Prompt
|
||||
prompt = f"Crafty Controller v{helper.get_version_string()} > "
|
||||
|
||||
# see MR !233 for pylint exemptino reason
|
||||
@staticmethod
|
||||
def emptyline():
|
||||
def emptyline(): # pylint: disable=arguments-differ
|
||||
pass
|
||||
|
||||
# pylint: disable=unused-argument
|
||||
def do_exit(self, line):
|
||||
def do_exit(self, _line):
|
||||
self.tasks_manager._main_graceful_exit()
|
||||
self.universal_exit()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user