diff --git a/modules/base/utils.py b/modules/base/utils.py index 14d65b317360613053db26c45ea63c34390894e5..448f9397247cc0e8bcf397ab66d79c7e744c44a6 100644 --- a/modules/base/utils.py +++ b/modules/base/utils.py @@ -102,8 +102,8 @@ class EngineUtil: ██╔â•â•██║██║ ██║██╔â•â•██╗██╔â•â•██║ ██╔â•â•╠██║╚██╗██║██║ ██║██║██║╚██╗██║██╔â•â•╠██║ ██║╚██████╔â•██║ ██║██║ ██║ ███████╗██║ ╚████║╚██████╔â•██║██║ ╚████║███████╗ ╚â•╠╚â•╠╚â•â•â•â•â•╠╚â•╠╚â•â•╚â•╠╚â•╠╚â•â•â•â•â•â•â•╚â•╠╚â•â•â•╠╚â•â•â•â•â•╠╚â•â•╚â•╠╚â•â•â•â•╚â•â•â•â•â•â•â• - v%s | %s - Ready to play! - \n""" % (version, component) + %s v%s - Ready to play! + \n""" % (component, version) @@ -128,7 +128,7 @@ class SimpleUtil: @staticmethod - def timestamp(date_and_time=datetime.datetime.now()): + def timestamp(date_and_time=None): """ Transforms the given `datetime` into a UNIX epoch timestamp. If no parameter is passed, the current timestamp is returned. @@ -139,6 +139,8 @@ class SimpleUtil: Returns: (Integer): timestamp in seconds. """ + if not date_and_time: + date_and_time = datetime.datetime.now() return time.mktime(date_and_time.timetuple()) @@ -164,7 +166,7 @@ class SimpleUtil: """ Creates a red version of the given text. """ - return TerminalColors.Red + text + TerminalColors.ENDC + return TerminalColors.RED.value + text + TerminalColors.ENDC.value @staticmethod @@ -175,6 +177,15 @@ class SimpleUtil: return TerminalColors.PINK.value + text + TerminalColors.ENDC.value + @staticmethod + def green(text): + """ + Creates a red version of the given text. + """ + return TerminalColors.GREEN.value + text + TerminalColors.ENDC.value + + + class TerminalColors(Enum): """