(seconds: int)
| 40 | |
| 41 | |
| 42 | def get_readable_time(seconds: int) -> str: |
| 43 | result = '' |
| 44 | (days, remainder) = divmod(seconds, 86400) |
| 45 | days = int(days) |
| 46 | if days != 0: |
| 47 | result += f'{days}d' |
| 48 | (hours, remainder) = divmod(remainder, 3600) |
| 49 | hours = int(hours) |
| 50 | if hours != 0: |
| 51 | result += f'{hours}h' |
| 52 | (minutes, seconds) = divmod(remainder, 60) |
| 53 | minutes = int(minutes) |
| 54 | if minutes != 0: |
| 55 | result += f'{minutes}m' |
| 56 | seconds = int(seconds) |
| 57 | result += f'{seconds}s' |
| 58 | return result |
| 59 | |
| 60 | |
| 61 |
nothing calls this directly
no outgoing calls
no test coverage detected