From 6d4a7271fb69a065a7d41f7500044f5c2f6bba05 Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Mon, 11 Nov 2024 12:08:00 +0100 Subject: [PATCH] Walker -> TupleWalker --- experimental/dbx2dab/dbx2dab/compare.py | 8 +++++--- experimental/dbx2dab/dbx2dab/loader.py | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/experimental/dbx2dab/dbx2dab/compare.py b/experimental/dbx2dab/dbx2dab/compare.py index b6cd7da6..3bc9dc92 100644 --- a/experimental/dbx2dab/dbx2dab/compare.py +++ b/experimental/dbx2dab/dbx2dab/compare.py @@ -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) diff --git a/experimental/dbx2dab/dbx2dab/loader.py b/experimental/dbx2dab/dbx2dab/loader.py index 4ce1db66..c9904c82 100644 --- a/experimental/dbx2dab/dbx2dab/loader.py +++ b/experimental/dbx2dab/dbx2dab/loader.py @@ -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: