Skip to content

Commit 1b7e225

Browse files
authored
chore: minor formatting fixes (#277)
1 parent d252afe commit 1b7e225

File tree

2 files changed

+22
-21
lines changed

2 files changed

+22
-21
lines changed

adbe/asyncio_helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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 = [

adbe/output_helper.py

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,48 @@
11
import sys
22

3-
__VERBOSE_MODE = False
3+
__VERBOSE_MODE: bool = False
44

55

6-
def set_verbose(enabled):
6+
def set_verbose(enabled: bool) -> None:
77
global __VERBOSE_MODE
88
__VERBOSE_MODE = enabled
99

1010

11-
def print_message(message):
11+
def print_message(message: str) -> None:
1212
print(message)
1313

1414

15-
def print_error_and_exit(error_string):
15+
def print_error_and_exit(error_string: str) -> None:
1616
print_error(error_string)
1717
sys.exit(1)
1818

1919

20-
def print_error(error_string):
20+
def print_error(error_string: str) -> None:
2121
if _is_interactive_terminal():
22-
error_string = '%s%s%s' % (BashColors.FAIL, error_string, BashColors.ENDC)
23-
print(error_string)
22+
print(f"{BashColors.FAIL}{error_string}{BashColors.ENDC}")
23+
else:
24+
print(error_string)
2425

2526

26-
def print_verbose(message):
27-
if __VERBOSE_MODE:
28-
if _is_interactive_terminal():
29-
message = '%s%s%s' % (BashColors.WARNING, message, BashColors.ENDC)
27+
def print_verbose(message: str) -> None:
28+
if __VERBOSE_MODE and _is_interactive_terminal():
29+
print(f"{BashColors.WARNING}{message}{BashColors.ENDC}")
30+
else:
3031
print(message)
3132

3233

33-
def _is_interactive_terminal():
34+
def _is_interactive_terminal() -> bool:
3435
return sys.stdout.isatty()
3536

3637

3738
# Coloring approach inspired from https://stackoverflow.com/a/287944
3839
# pylint: disable=too-few-public-methods
3940
class 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'
41+
HEADER = "\033[95m"
42+
OKBLUE = "\033[94m"
43+
OKGREEN = "\033[92m"
44+
WARNING = "\033[93m"
45+
FAIL = "\033[91m"
46+
ENDC = "\033[0m"
47+
BOLD = "\033[1m"
48+
UNDERLINE = "\033[4m"

0 commit comments

Comments
 (0)