Appease the linter

This commit is contained in:
Andrew 2022-03-13 09:26:38 -04:00
parent fdce9e2539
commit d4a1efba78
6 changed files with 16 additions and 16 deletions

View File

@ -106,11 +106,11 @@ class Users_Controller:
@staticmethod
def user_id_exists(user_id):
return users_helper.user_id_exists(user_id)
@staticmethod
def set_prepare(user_id):
return users_helper.set_prepare(user_id)
@staticmethod
def stop_prepare(user_id):
return users_helper.stop_prepare(user_id)

View File

@ -197,17 +197,18 @@ class helper_users:
@staticmethod
def set_support_path(user_id, support_path):
Users.update(support_logs = support_path).where(Users.user_id == user_id).execute()
@staticmethod
def set_prepare(user_id):
Users.update(preparing = True).where(Users.user_id == user_id).execute()
@staticmethod
def stop_prepare(user_id):
Users.update(preparing = False).where(Users.user_id == user_id).execute()
@staticmethod
def clear_support_status():
#pylint: disable=singleton-comparison
Users.update(preparing = False).where(Users.preparing == True).execute()
@staticmethod

View File

@ -423,7 +423,7 @@ class Helpers:
def get_time_as_string():
now = datetime.now()
return now.strftime("%m/%d/%Y, %H:%M:%S")
@staticmethod
def calc_percent(source_path, dest_path):
#calculates percentable of zip from drive. Not with compression. For backups and support logs

View File

@ -6,7 +6,6 @@ import time
import logging
import tempfile
from typing import Union
from urllib import request
from app.classes.controllers.crafty_perms_controller import Crafty_Perms_Controller
from app.classes.controllers.management_controller import Management_Controller
@ -174,7 +173,7 @@ class Controller:
self.support_scheduler.add_job(self.log_status, 'interval', seconds=1, id="logs_"+str(exec_user['user_id']), args = [full_temp,
tempZipStorage +'.zip', exec_user])
file_helper.make_archive(tempZipStorage, tempDir)
if len(websocket_helper.clients) > 0:
websocket_helper.broadcast_user(exec_user['user_id'], 'support_status_update', helper.calc_percent(full_temp, tempZipStorage +'.zip'))
@ -183,7 +182,7 @@ class Controller:
})
self.users.set_support_path(exec_user['user_id'], tempZipStorage)
self.users.stop_prepare(exec_user['user_id'])
self.support_scheduler.remove_job('logs_'+str(exec_user["user_id"]))
@ -207,14 +206,14 @@ class Controller:
svr.start_crash_detection()
else:
svr.stop_crash_detection()
def log_status(self, source_path, dest_path, exec_user):
results = helper.calc_percent(source_path, dest_path)
self.log_stats = results
if len(websocket_helper.clients) > 0:
websocket_helper.broadcast_user(exec_user['user_id'], 'support_status_update', results)
def send_log_status(self):
try:
return self.log_stats
@ -637,7 +636,7 @@ class Controller:
@staticmethod
def clear_unexecuted_commands():
helpers_management.clear_unexecuted_commands()
@staticmethod
def clear_support_status():
helper_users.clear_support_status()

View File

@ -605,7 +605,7 @@ class Server:
def a_backup_server(self):
if len(websocket_helper.clients) > 0:
websocket_helper.broadcast_page_params(
websocket_helper.broadcast_page_params(
'/panel/server_detail',
{
'id': str(self.server_id)
@ -705,7 +705,7 @@ class Server:
)
self.is_backingup = False
return
def backup_status(self, source_path, dest_path):
results = helper.calc_percent(source_path, dest_path)
self.backup_stats = results
@ -718,7 +718,7 @@ class Server:
'backup_status',
results
)
def send_backup_status(self):
try:
return self.backup_stats

View File

@ -308,7 +308,7 @@ class AjaxHandler(BaseHandler):
elif page == "send_order":
self.controller.users.update_server_order(exec_user['user_id'], bleach.clean(self.get_argument('order')))
return
elif page == "backup_now":
server_id = self.get_argument('id', None)
if server_id is None: