Skip to content

Commit 8d32e3e

Browse files
authored
Update tz_tool.py
1 parent 26c5bcc commit 8d32e3e

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

timezone_cli/tz_tool.py

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def print_help():
1111
print('[+] use --cm to get the time of common timezones around the world.')
1212
print('[+] use --cmp and pass two \'-\' seperated timezones to compare.')
1313
print('[+] use --help again if needed.')
14-
print('\n' + '-'*50 + '\n')
14+
print('\n' + '-' * 50 + '\n')
1515

1616

1717
# --- GET DATETIME OF PASSED TIMEZONE ---
@@ -24,14 +24,14 @@ def get_datetime(time_zone):
2424
# --- GET DATETIME OF CUSTOM TIMEZONE ---
2525
def get_custom_tz(time_zone):
2626
response = str(get_datetime(time_zone))
27-
print(f'%20s' % 'Timezone' + ' :' + ' '*2 + time_zone)
27+
print(f'%20s' % 'Timezone' + ' :' + ' ' * 2 + time_zone) # noqa
2828
date, time = response.split(' ')
2929
hours, minutes, seconds = time.split(':')
30-
print('%20s' % 'Hours' + ' :' + ' '*2 + hours)
31-
print('%20s' % 'Minutes' + ' :' + ' '*2 + minutes)
32-
print('%20s' % 'Seconds' + ' :' + ' '*2 + seconds)
33-
print('%20s' % 'Date' + ' :' + ' '*2 + date)
34-
print('\n' + '-'*50 + '\n')
30+
print('%20s' % 'Hours' + ' :' + ' ' * 2 + hours)
31+
print('%20s' % 'Minutes' + ' :' + ' ' * 2 + minutes)
32+
print('%20s' % 'Seconds' + ' :' + ' ' * 2 + seconds)
33+
print('%20s' % 'Date' + ' :' + ' ' * 2 + date)
34+
print('\n' + '-' * 50 + '\n')
3535

3636

3737
# --- GET DATETIMES OF COMMON TIMEZONES ---
@@ -63,14 +63,14 @@ def get_comparisons(tz_1, tz_2):
6363
print('%25s' % 'Hours :', offset.hours)
6464
print('%25s' % 'Minutes :', offset.minutes)
6565
print('%25s' % 'Seconds :', offset.seconds)
66-
print('\n' + '-'*50 + '\n')
66+
print('\n' + '-' * 50 + '\n')
6767

6868

6969
# --- MAIN FUNCTION ---
7070
def Main():
71-
print('\n' + '-'*50 + '\n')
72-
print(' '*16 + 'TIMEZONE TOOL')
73-
print('\n' + '-'*50 + '\n')
71+
print('\n' + '-' * 50 + '\n')
72+
print(' ' * 16 + 'TIMEZONE TOOL')
73+
print('\n' + '-' * 50 + '\n')
7474

7575
# --- SET DEFAULTS ---
7676
argument_list = sys.argv[1:]
@@ -92,11 +92,12 @@ def Main():
9292
if len(timezones) == 2:
9393
get_comparisons(timezones[0], timezones[1])
9494
else:
95-
print(' '*5, '[+] Seperate the Timezones with \'-\'')
96-
print('\n' + '-'*50 + '\n')
95+
print(' ' * 5, '[+] Seperate the Timezones with \'-\'')
96+
print('\n' + '-' * 50 + '\n')
9797

9898
except getopt.error as error:
9999
print(str(error))
100100

101+
101102
if __name__ == '__main__':
102103
Main()

0 commit comments

Comments
 (0)