Walker -> TupleWalker

This commit is contained in:
Pieter Noordhuis 2024-11-11 12:08:00 +01:00
parent b58a6fc099
commit 6d4a7271fb
No known key found for this signature in database
GPG Key ID: 12ACCCC104CF2930
2 changed files with 7 additions and 5 deletions

View File

@ -252,7 +252,7 @@ def recursive_subtract_list(list1: List[any], list2: List[any]):
return result
class Walker:
class TupleWalker:
_insert_callback = None
_update_callback = None
_delete_callback = None
@ -319,8 +319,10 @@ class Walker:
self.update_callback(path, o1, o2)
def walk(o1, o2, insert_callback=None, update_callback=None, delete_callback=None):
walker = Walker(insert_callback, update_callback, delete_callback)
def tuple_walk(
o1, o2, insert_callback=None, update_callback=None, delete_callback=None
):
walker = TupleWalker(insert_callback, update_callback, delete_callback)
walker.walk(o1, o2)

View File

@ -3,7 +3,7 @@ from typing import Dict, List, Tuple
import yaml
from dbx2dab.config_reader import ConfigReader
from dbx2dab.compare import walk
from dbx2dab.compare import tuple_walk
class VerboseSafeDumper(yaml.SafeDumper):
@ -138,7 +138,7 @@ class Loader:
correctly_replaced = False
return
walk(complete_config, config, update_callback=update_callback)
tuple_walk(complete_config, config, update_callback=update_callback)
# If we found an incompatible replacement, bail.
if not correctly_replaced: