File tree Expand file tree Collapse file tree 2 files changed +17
-24
lines changed
Expand file tree Collapse file tree 2 files changed +17
-24
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ def execute_in_parallel(method_to_call, params_list):
1111 num_workers = 50
1212 loop = asyncio .get_event_loop ()
1313
14- async def _list_debug_apps_async (params_list2 ):
14+ async def _list_debug_apps_async (params_list2 ) -> None :
1515 with concurrent .futures .ThreadPoolExecutor (max_workers = num_workers ) as executor :
1616 loop = asyncio .get_event_loop ()
1717 futures = [
Original file line number Diff line number Diff line change 33__VERBOSE_MODE = False
44
55
6- def set_verbose (enabled ):
6+ def set_verbose (enabled ) -> None :
77 global __VERBOSE_MODE
88 __VERBOSE_MODE = enabled
99
1010
11- def print_message (message ):
12- print (message )
13-
14-
15- def print_error_and_exit (error_string ):
11+ def print_error_and_exit (error_string ) -> None :
1612 print_error (error_string )
1713 sys .exit (1 )
1814
1915
20- def print_error (error_string ):
16+ def print_error (error_string ) -> None :
2117 if _is_interactive_terminal ():
22- error_string = '%s%s%s' % (BashColors .FAIL , error_string , BashColors .ENDC )
23- print (error_string )
18+ error_string = f"{ BashColors .FAIL } { error_string } { BashColors .ENDC } "
2419
2520
26- def print_verbose (message ):
27- if __VERBOSE_MODE :
28- if _is_interactive_terminal ():
29- message = '%s%s%s' % (BashColors .WARNING , message , BashColors .ENDC )
30- print (message )
21+ def print_verbose (message ) -> None :
22+ if __VERBOSE_MODE and _is_interactive_terminal ():
23+ message = f"{ BashColors .WARNING } { message } { BashColors .ENDC } "
3124
3225
33- def _is_interactive_terminal ():
26+ def _is_interactive_terminal () -> bool :
3427 return sys .stdout .isatty ()
3528
3629
3730# Coloring approach inspired from https://stackoverflow.com/a/287944
3831# pylint: disable=too-few-public-methods
3932class BashColors :
40- HEADER = ' \033 [95m'
41- OKBLUE = ' \033 [94m'
42- OKGREEN = ' \033 [92m'
43- WARNING = ' \033 [93m'
44- FAIL = ' \033 [91m'
45- ENDC = ' \033 [0m'
46- BOLD = ' \033 [1m'
47- UNDERLINE = ' \033 [4m'
33+ HEADER = " \033 [95m"
34+ OKBLUE = " \033 [94m"
35+ OKGREEN = " \033 [92m"
36+ WARNING = " \033 [93m"
37+ FAIL = " \033 [91m"
38+ ENDC = " \033 [0m"
39+ BOLD = " \033 [1m"
40+ UNDERLINE = " \033 [4m"
You can’t perform that action at this time.
0 commit comments