26
src/util.py
26
src/util.py
@@ -22,3 +22,29 @@ class Util:
|
||||
time += str(seconds) + "s"
|
||||
|
||||
return time
|
||||
|
||||
@staticmethod
|
||||
def format_time_to_seconds(time: str) -> int:
|
||||
seconds = 0
|
||||
|
||||
hours = time.split("h")
|
||||
if len(hours) > 1:
|
||||
seconds += (60 * 60 * int(hours.pop(0)))
|
||||
time = hours.pop(0)
|
||||
|
||||
minutes = time.split("m")
|
||||
if len(minutes) > 1:
|
||||
seconds += (60 * int(minutes.pop(0)))
|
||||
time = minutes.pop(0)
|
||||
|
||||
seconds += int(time[0:-1]) if len(time) > 0 else 0
|
||||
|
||||
return seconds
|
||||
|
||||
@staticmethod
|
||||
def get_default_button_color():
|
||||
return "#3a7ebf", "#1f538d"
|
||||
|
||||
@staticmethod
|
||||
def get_default_active_button_color():
|
||||
return "gray29", "gray29"
|
||||
|
Reference in New Issue
Block a user