summaryrefslogtreecommitdiff
path: root/config.py
diff options
context:
space:
mode:
authorScott <[email protected]>2022-01-31 21:38:46 -0800
committerScott <[email protected]>2022-01-31 21:38:46 -0800
commit9eba12cba5641d6a0b988038694cbc2dd52800c5 (patch)
tree450a3274655a3f07e33917db4812792c0a025952 /config.py
parente224aee343a337beefc61acdfa263c88f0bde312 (diff)
Myre mypy fixes.
Diffstat (limited to 'config.py')
-rw-r--r--config.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/config.py b/config.py
index f543b0a..588b7e0 100644
--- a/config.py
+++ b/config.py
@@ -80,8 +80,8 @@ from typing import Any, Dict, List, Optional
saved_messages: List[str] = []
# Make a copy of the original program arguments.
-program_name = os.path.basename(sys.argv[0])
-original_argv = [arg for arg in sys.argv]
+program_name: str = os.path.basename(sys.argv[0])
+original_argv: List[str] = [arg for arg in sys.argv]
# A global parser that we will collect arguments into.
@@ -101,7 +101,7 @@ config_parse_called = False
# It is also this variable that modules use to access parsed arguments.
# This is the data that is most interesting to our callers; it will hold
# the configuration result.
-config = {}
+config: Dict[str, Any] = {}
# It would be really nice if this shit worked from interactive python
@@ -154,11 +154,12 @@ def is_flag_already_in_argv(var: str):
def reorder_arg_action_groups(entry_module: Optional[str]):
+ global program_name, args
reordered_action_groups = []
for group in args._action_groups:
- if entry_module is not None and entry_module in group.title:
+ if entry_module is not None and entry_module in group.title: # type: ignore
reordered_action_groups.append(group)
- elif program_name in group.title:
+ elif program_name in group.title: # type: ignore
reordered_action_groups.append(group)
else:
reordered_action_groups.insert(0, group)