mirror of
https://github.com/keanuplayz/dotfiles.git
synced 2024-08-15 02:33:12 +00:00
[welcome] refactor 'is empty' checks
This commit is contained in:
parent
9eb971416a
commit
1607eaca4f
1 changed files with 3 additions and 3 deletions
|
@ -30,9 +30,9 @@ def format_timedelta(timedelta):
|
|||
|
||||
if days > 0:
|
||||
result.append('%d day%s' % plural(days))
|
||||
if hh > 0 or len(result) > 0:
|
||||
if hh > 0 or result:
|
||||
result.append('%d hour%s' % plural(hh))
|
||||
if mm > 0 or len(result) > 0:
|
||||
if mm > 0 or result:
|
||||
result.append('%d min%s' % plural(mm))
|
||||
if len(result) <= 1:
|
||||
result.append('%d sec%s' % plural(ss))
|
||||
|
@ -184,7 +184,7 @@ def get_system_info():
|
|||
|
||||
def info(name, value, *format_args):
|
||||
line = colored(name + ':', Style.BRIGHT, Fore.YELLOW) + ' ' + value
|
||||
if len(format_args) > 0:
|
||||
if format_args:
|
||||
line = line % format_args
|
||||
info_lines.append(line)
|
||||
|
||||
|
|
Loading…
Reference in a new issue