Skip to content

Commit

Permalink
Use math fns directly from import math
Browse files Browse the repository at this point in the history
  • Loading branch information
siznax committed Jun 10, 2021
1 parent 0cc9f3f commit 5159df0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Moo/play/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
'''

import os
import math
import time

from math import floor, ceil


def file_age(filepath):
'''
Expand All @@ -23,15 +22,15 @@ def hours_minutes(seconds, colons=False):
hour = 60 * minute

if seconds >= hour:
hours = floor(seconds / hour)
hours = math.floor(seconds / hour)
seconds = seconds % hour
if colons:
out.append(str(hours).zfill(2))
else:
out.append('{}h'.format(hours))

if seconds >= minute:
minutes = ceil(seconds / minute)
minutes = math.ceil(seconds / minute)
if colons:
out.append(str(minutes).zfill(2))
else:
Expand Down

0 comments on commit 5159df0

Please sign in to comment.