Make Onionr more user friendly

This commit mostly just made messages more readable, worked on logger, and fixed a few bugs
This commit is contained in:
Arinerron 2018-11-10 19:25:40 -08:00
parent 22115891f2
commit bb08162019
No known key found for this signature in database
GPG key ID: 99383627861C62F0
16 changed files with 245 additions and 152 deletions

View file

@ -140,3 +140,23 @@ class DaemonTools:
return True
return False
def humanReadableTime(self, seconds):
build = ''
units = {
'year' : 31557600,
'month' : (31557600 / 12),
'day' : 86400,
'hour' : 3600,
'minute' : 60,
'second' : 1
}
for unit in units:
amnt_unit = int(seconds / units[unit])
if amnt_unit >= 1:
seconds -= amnt_unit * units[unit]
build += '%s %s' % (amnt_unit, unit) + ('s' if amnt_unit != 1 else '') + ' '
return build.strip()