maketool 0.8.21__tar.gz → 0.8.23__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {maketool-0.8.21 → maketool-0.8.23}/PKG-INFO +1 -1
- {maketool-0.8.21 → maketool-0.8.23}/maketool/sublime.py +29 -1
- {maketool-0.8.21 → maketool-0.8.23}/maketool.egg-info/PKG-INFO +1 -1
- {maketool-0.8.21 → maketool-0.8.23}/pyproject.toml +1 -1
- {maketool-0.8.21 → maketool-0.8.23}/README.md +0 -0
- {maketool-0.8.21 → maketool-0.8.23}/maketool/__init__.py +0 -0
- {maketool-0.8.21 → maketool-0.8.23}/maketool/build.py +0 -0
- {maketool-0.8.21 → maketool-0.8.23}/maketool/clean.py +0 -0
- {maketool-0.8.21 → maketool-0.8.23}/maketool/compile.py +0 -0
- {maketool-0.8.21 → maketool-0.8.23}/maketool/refscan.py +0 -0
- {maketool-0.8.21 → maketool-0.8.23}/maketool/run.py +0 -0
- {maketool-0.8.21 → maketool-0.8.23}/maketool.egg-info/SOURCES.txt +0 -0
- {maketool-0.8.21 → maketool-0.8.23}/maketool.egg-info/dependency_links.txt +0 -0
- {maketool-0.8.21 → maketool-0.8.23}/maketool.egg-info/entry_points.txt +0 -0
- {maketool-0.8.21 → maketool-0.8.23}/maketool.egg-info/top_level.txt +0 -0
- {maketool-0.8.21 → maketool-0.8.23}/setup.cfg +0 -0
|
@@ -161,6 +161,30 @@ def _upsert_keybindings(existing: list[dict], updates: list[dict]) -> list[dict]
|
|
|
161
161
|
out.append(upd)
|
|
162
162
|
return out
|
|
163
163
|
|
|
164
|
+
def _prune_maketool_bindings(existing: list[dict], maketool: list[dict]) -> list[dict]:
|
|
165
|
+
"""
|
|
166
|
+
Remove existing bindings that represent the same maketool intent
|
|
167
|
+
(command + args.variant), regardless of key.
|
|
168
|
+
"""
|
|
169
|
+
def intent(item: dict) -> tuple:
|
|
170
|
+
return (
|
|
171
|
+
item.get("command"),
|
|
172
|
+
(item.get("args") or {}).get("variant")
|
|
173
|
+
)
|
|
174
|
+
|
|
175
|
+
maketool_intents = {intent(m) for m in maketool}
|
|
176
|
+
|
|
177
|
+
out = []
|
|
178
|
+
for item in existing:
|
|
179
|
+
if not isinstance(item, dict):
|
|
180
|
+
out.append(item)
|
|
181
|
+
continue
|
|
182
|
+
if intent(item) in maketool_intents:
|
|
183
|
+
continue
|
|
184
|
+
out.append(item)
|
|
185
|
+
|
|
186
|
+
return out
|
|
187
|
+
|
|
164
188
|
|
|
165
189
|
def process(user_packages_dir: str) -> None:
|
|
166
190
|
os.makedirs(user_packages_dir, exist_ok=True)
|
|
@@ -207,7 +231,11 @@ def process(user_packages_dir: str) -> None:
|
|
|
207
231
|
]
|
|
208
232
|
|
|
209
233
|
existing_keymap = _load_json_or_empty(keymap_file_path)
|
|
210
|
-
|
|
234
|
+
existing_keymap = _prune_maketool_bindings(
|
|
235
|
+
existing_keymap,
|
|
236
|
+
maketool_bindings
|
|
237
|
+
)
|
|
238
|
+
new_keymap = _upsert_keybindings(existing_keymap, maketool_bindings)
|
|
211
239
|
|
|
212
240
|
# _backup(keymap_file_path)
|
|
213
241
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|