From 82df13f21f9cad73d49c375e92aa83c725824f09 Mon Sep 17 00:00:00 2001 From: ElJeffe Date: Tue, 26 Apr 2022 17:19:47 -0500 Subject: [PATCH] version bump, black --- bot/BotMonitor.py | 34 +++++++++++++++++----------------- bot/bot.py | 34 +++++++++++++++++----------------- handlers/PublicHandlers.py | 6 ++++-- models/Flag.py | 6 +++--- rootthebox.py | 4 ++-- setup/__init__.py | 2 +- 6 files changed, 44 insertions(+), 42 deletions(-) diff --git a/bot/BotMonitor.py b/bot/BotMonitor.py index 817ba8d9..0c20d247 100755 --- a/bot/BotMonitor.py +++ b/bot/BotMonitor.py @@ -789,24 +789,24 @@ def __init__( sockopt=(), ): """ - url: websocket url. - header: custom header for websocket handshake. - on_open: callable object which is called at opening websocket. + url: websocket url. + header: custom header for websocket handshake. + on_open: callable object which is called at opening websocket. + this function has one argument. The argument is this class object. + on_message: callbale object which is called when received data. + on_message has 2 arguments. + The 1st argument is this class object. + The passing 2nd argument is utf-8 string which we get from the server. + on_error: callable object which is called when we get error. + on_error has 2 arguments. + The 1st argument is this class object. + The passing 2nd argument is exception object. + on_close: callable object which is called when closed the connection. this function has one argument. The argument is this class object. - on_message: callbale object which is called when received data. - on_message has 2 arguments. - The 1st argument is this class object. - The passing 2nd argument is utf-8 string which we get from the server. - on_error: callable object which is called when we get error. - on_error has 2 arguments. - The 1st argument is this class object. - The passing 2nd argument is exception object. - on_close: callable object which is called when closed the connection. - this function has one argument. The argument is this class object. - keep_running: a boolean flag indicating whether the app's main loop should - keep running, defaults to True - get_mask_key: a callable to produce new mask keys, see the WebSocket.set_mask_key's - docstring for more information + keep_running: a boolean flag indicating whether the app's main loop should + keep running, defaults to True + get_mask_key: a callable to produce new mask keys, see the WebSocket.set_mask_key's + docstring for more information """ self.url = url self.header = header or [] diff --git a/bot/bot.py b/bot/bot.py index 275a7349..386eb591 100755 --- a/bot/bot.py +++ b/bot/bot.py @@ -809,24 +809,24 @@ def __init__( sockopt=(), ): """ - url: websocket url. - header: custom header for websocket handshake. - on_open: callable object which is called at opening websocket. + url: websocket url. + header: custom header for websocket handshake. + on_open: callable object which is called at opening websocket. + this function has one argument. The argument is this class object. + on_message: callbale object which is called when received data. + on_message has 2 arguments. + The 1st argument is this class object. + The passing 2nd argument is utf-8 string which we get from the server. + on_error: callable object which is called when we get error. + on_error has 2 arguments. + The 1st argument is this class object. + The passing 2nd argument is exception object. + on_close: callable object which is called when closed the connection. this function has one argument. The argument is this class object. - on_message: callbale object which is called when received data. - on_message has 2 arguments. - The 1st argument is this class object. - The passing 2nd argument is utf-8 string which we get from the server. - on_error: callable object which is called when we get error. - on_error has 2 arguments. - The 1st argument is this class object. - The passing 2nd argument is exception object. - on_close: callable object which is called when closed the connection. - this function has one argument. The argument is this class object. - keep_running: a boolean flag indicating whether the app's main loop should - keep running, defaults to True - get_mask_key: a callable to produce new mask keys, see the WebSocket.set_mask_key's - docstring for more information + keep_running: a boolean flag indicating whether the app's main loop should + keep running, defaults to True + get_mask_key: a callable to produce new mask keys, see the WebSocket.set_mask_key's + docstring for more information """ self.url = url self.header = header diff --git a/handlers/PublicHandlers.py b/handlers/PublicHandlers.py index 1cdae4e7..280be084 100644 --- a/handlers/PublicHandlers.py +++ b/handlers/PublicHandlers.py @@ -566,7 +566,8 @@ def send_validate_message(self, user): emailtoken.value = sha256(email_token).hexdigest() receivers = [user.email] message = email_rfc2822_compliance( - self.create_validate_message(user, email_token)) + self.create_validate_message(user, email_token) + ) smtpObj = smtplib.SMTP(options.mail_host, port=options.mail_port) smtpObj.set_debuglevel(False) try: @@ -743,7 +744,8 @@ def post(self, *args, **kwargs): self.dbsession.commit() receivers = [user.email] message = email_rfc2822_compliance( - self.create_reset_message(user, reset_token)) + self.create_reset_message(user, reset_token) + ) smtpObj = smtplib.SMTP(options.mail_host, port=options.mail_port) smtpObj.set_debuglevel(False) try: diff --git a/models/Flag.py b/models/Flag.py index 8cf24fcd..f32b0412 100644 --- a/models/Flag.py +++ b/models/Flag.py @@ -335,10 +335,10 @@ def case_sensitive(self, value): @property def value(self): if self._original_value and self._original_value > self._value: - """ Since value itself is no longer decreased in dynamic scoring + """Since value itself is no longer decreased in dynamic scoring there is no need for original_value, but for backward compatibility - if _original_value is GT the value, update the value. - At some point, we can remove original_value column. """ + if _original_value is GT the value, update the value. + At some point, we can remove original_value column.""" self.value = self._original_value return self._value diff --git a/rootthebox.py b/rootthebox.py index d5b3b442..294411b7 100755 --- a/rootthebox.py +++ b/rootthebox.py @@ -1066,10 +1066,10 @@ def help(): if options.version: version() elif options.setup.startswith("docker"): - if (not os.path.isfile(options.config) or ( + if not os.path.isfile(options.config) or ( options.sql_dialect == "sqlite" and not os.path.isfile(options.sql_database) - and not os.path.isfile("%s.db" % options.sql_database)) + and not os.path.isfile("%s.db" % options.sql_database) ): logging.info("Running Docker Setup") if os.path.isfile(options.config): diff --git a/setup/__init__.py b/setup/__init__.py index 808a1dba..7f32f593 100644 --- a/setup/__init__.py +++ b/setup/__init__.py @@ -1,2 +1,2 @@ # -*- coding: utf-8 -*- -__version__ = "3.10.2" +__version__ = "3.10.3"