diff --git a/Crx/patchbuilder.py b/Crx/patchbuilder.py index 62fac02..e240198 100644 --- a/Crx/patchbuilder.py +++ b/Crx/patchbuilder.py @@ -20,8 +20,13 @@ def _build_patch_set(change: dict) -> str: return ''.join(line) +def _build_patch_delete(change: dict) -> str: + return f'-{change["path"]} : ' + + _patch_builders = { - 'set': _build_patch_set + 'set': _build_patch_set, + 'delete': _build_patch_delete, } @@ -41,6 +46,13 @@ class PatchBuilder: 'type': value_type }) + def delete_node(self, path: str): + self.changes.append({ + 'action': 'delete', + 'path': path + }) + pass + def save(self): patch = [] for entry in self.changes: