Commit 1981e292 authored by David Trattnig's avatar David Trattnig
Browse files

Green method, fix for timestamp, info formatting.

parent b2cf613b
......@@ -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):
"""
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment