@@ -7,9 +7,10 @@ from pathlib import Path, PurePath
7
7
from typing import Dict , List , Tuple
8
8
9
9
from zulipterminal .config .keys import (
10
- HELP_CATEGORIES ,
11
- KEY_BINDINGS ,
12
- display_keys_for_command ,
10
+ # HELP_CATEGORIES,
11
+ # KEY_BINDINGS,
12
+ # display_keys_for_command,
13
+ key_config ,
13
14
)
14
15
15
16
@@ -42,7 +43,7 @@ def lint_hotkeys_file() -> None:
42
43
# To lint keys description
43
44
error_flag = 0
44
45
categories = read_help_categories ()
45
- for action in HELP_CATEGORIES :
46
+ for action in key_config . HELP_CATEGORIES :
46
47
check_duplicate_keys_list : List [str ] = []
47
48
for help_text , key_combinations_list in categories [action ]:
48
49
check_duplicate_keys_list .extend (key_combinations_list )
@@ -65,7 +66,7 @@ def lint_hotkeys_file() -> None:
65
66
]
66
67
if len (duplicate_keys ) != 0 :
67
68
print (
68
- f"Duplicate key combination for keys { duplicate_keys } for category ({ HELP_CATEGORIES [action ]} ) detected"
69
+ f"Duplicate key combination for keys { duplicate_keys } for category ({ key_config . HELP_CATEGORIES [action ]} ) detected"
69
70
)
70
71
error_flag = 1
71
72
if error_flag == 1 :
@@ -101,9 +102,9 @@ def get_hotkeys_file_string() -> str:
101
102
f"<!--- Generated automatically by tools/{ SCRIPT_NAME } -->\n "
102
103
"<!--- Do not modify -->\n \n # Hot Keys\n "
103
104
)
104
- for action in HELP_CATEGORIES :
105
+ for action in key_config . HELP_CATEGORIES :
105
106
hotkeys_file_string += (
106
- f"## { HELP_CATEGORIES [action ]} \n "
107
+ f"## { key_config . HELP_CATEGORIES [action ]} \n "
107
108
"|Command|Key Combination|\n "
108
109
"| :--- | :---: |\n "
109
110
)
@@ -135,9 +136,9 @@ def read_help_categories() -> Dict[str, List[Tuple[str, List[str]]]]:
135
136
Get all help categories from KEYS_FILE
136
137
"""
137
138
categories = defaultdict (list )
138
- for cmd , item in KEY_BINDINGS .items ():
139
+ for cmd , item in key_config . KEY_BINDINGS .items ():
139
140
categories [item ["key_category" ]].append (
140
- (item ["help_text" ], display_keys_for_command (cmd ))
141
+ (item ["help_text" ], key_config . display_keys_for_command (cmd ))
141
142
)
142
143
return categories
143
144
0 commit comments