MCPcopy Index your code
hub / github.com/pyload/pyload / format_time

Function format_time

module/plugins/internal/misc.py:260–267  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

258 return b2a_hex(signer.sign(digest))
259
260def format_time(value):
261 dt = datetime.datetime(1, 1, 1) + \
262 datetime.timedelta(seconds=abs(int(value)))
263 days = ("%d days" % (dt.day - 1)) if dt.day > 1 else ""
264 tm = ", ".join("%d %ss" % (getattr(dt, attr), attr)
265 for attr in ("hour", "minute", "second")
266 if getattr(dt, attr))
267 return days + (" and " if days and tm else "") + tm
268
269def format_size(value):
270 for unit in ('B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB'):

Callers 2

waitMethod · 0.70
package_check_failedMethod · 0.50

Calls 1

joinMethod · 0.80

Tested by

no test coverage detected