(value)
| 258 | return b2a_hex(signer.sign(digest)) |
| 259 | |
| 260 | def 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 | |
| 269 | def format_size(value): |
| 270 | for unit in ('B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB'): |
no test coverage detected