mirror of
https://github.com/craigerl/aprsd.git
synced 2025-08-03 22:12:30 -04:00
Added days to uptime string formatting
The uptime string formatter was missing days.
This commit is contained in:
parent
0f384b0e85
commit
2e9b42d7af
@ -399,6 +399,9 @@ def strfdelta(tdelta, fmt="{hours:{width}}:{minutes:{width}}:{seconds:{width}}")
|
|||||||
"days": tdelta.days,
|
"days": tdelta.days,
|
||||||
"width": "02",
|
"width": "02",
|
||||||
}
|
}
|
||||||
|
if tdelta.days > 0:
|
||||||
|
fmt = "{days} days " + fmt
|
||||||
|
|
||||||
d["hours"], rem = divmod(tdelta.seconds, 3600)
|
d["hours"], rem = divmod(tdelta.seconds, 3600)
|
||||||
d["minutes"], d["seconds"] = divmod(rem, 60)
|
d["minutes"], d["seconds"] = divmod(rem, 60)
|
||||||
return fmt.format(**d)
|
return fmt.format(**d)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user