MCPcopy
hub / github.com/budtmo/docker-android / convert_str_to_bool

Function convert_str_to_bool

cli/src/helper/__init__.py:7–21  ·  view source on GitHub ↗

Convert String to Boolean value :param given_str: given string :return: converted string in Boolean

(given_str: str)

Source from the content-addressed store, hash-verified

5
6
7def convert_str_to_bool(given_str: str) -> bool:
8 """
9 Convert String to Boolean value
10
11 :param given_str: given string
12 :return: converted string in Boolean
13 """
14 if given_str:
15 if type(given_str) is str:
16 return given_str.lower() in ("yes", "true", "t", "1")
17 else:
18 raise AttributeError
19 else:
20 logger.info(f"'{given_str}' is empty!")
21 return False
22
23
24def get_env_value_or_raise(env_key: str) -> str:

Callers 10

start_appiumFunction · 0.90
start_vnc_webFunction · 0.90
shared_logFunction · 0.90
__init__Method · 0.90
__init__Method · 0.90

Calls

no outgoing calls