2024-04-09 10:42:06 +00:00
|
|
|
from datetime import datetime
|
|
|
|
|
2023-06-20 14:40:34 +00:00
|
|
|
from .config import config, read_config, write_config
|
2024-01-29 08:24:47 +00:00
|
|
|
from .enums.colors import BColors
|
|
|
|
|
|
|
|
"""
|
|
|
|
Here are all global important functions.
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
|
def _apply_color(msg: str, color: BColors) -> str:
|
|
|
|
if color is BColors.ENDC:
|
|
|
|
return msg
|
|
|
|
return color.value + msg + BColors.ENDC.value
|
|
|
|
|
|
|
|
|
|
|
|
def output(msg: str, color: BColors = BColors.ENDC):
|
|
|
|
print(_apply_color(msg, color))
|
|
|
|
|
|
|
|
|
|
|
|
def user_input(msg: str, color: BColors = BColors.ENDC):
|
|
|
|
return input(_apply_color(msg, color)).strip()
|
2024-04-09 10:42:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
def get_current_millis() -> int:
|
|
|
|
dt = datetime.now()
|
|
|
|
return int(dt.microsecond / 1_000)
|