From 987c71c7fb6d49e4efc19b1d9c07e281749da959 Mon Sep 17 00:00:00 2001 From: Alexander Rolfes Date: Wed, 25 Oct 2023 17:27:29 +0200 Subject: [PATCH] Restore old formatting in zodbsync.py --- perfact/zodbsync/zodbsync.py | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/perfact/zodbsync/zodbsync.py b/perfact/zodbsync/zodbsync.py index 090aa34..613e048 100644 --- a/perfact/zodbsync/zodbsync.py +++ b/perfact/zodbsync/zodbsync.py @@ -691,18 +691,18 @@ def playback_paths(self, paths, recurse=True, override=False, self.num_obj_current = 0 self.num_obj_total = len(paths) - note = 'zodbsync/' - if len('paths') == 1: + note = 'zodbsync' + if len(paths) == 1: note += ': ' + paths[0] txn_mgr = self.start_transaction(note=note) - # Stack of paths that are to be played back (reversed - # alphabetical order, we pop elements from the top) + # Stack of paths that are to be played back (reversed alphabetical + # order, we pop elements from the top) self.playback_todo = [] todo = self.playback_todo # local alias - # Stack of paths for which we need to fix the order after - # everything below that path has been handled. + # Stack of paths for which we need to fix the order after everything + # below that path has been handled. self.playback_fixorder = [] fixorder = self.playback_fixorder # local alias @@ -710,27 +710,25 @@ def playback_paths(self, paths, recurse=True, override=False, # don't need to read it again from disk. self.fs_data = {} - # Reverse order, ensure that paths end in '/' so startswith can be - # used reliably and remove elements that are to be deleted in that - # reverse order so properties of their parents can take their - # place + # Reverse order, ensure that paths end in '/' so startswith can be used + # reliably and remove elements that are to be deleted in that reverse + # order so properties of their parents can take their place for path in reversed(paths): if not os.path.isdir(self.fs_path(path)): - # Call it immediately, it will read None from the FS and - # remove the object + # Call it immediately, it will read None from the FS and remove + # the object self._playback_path(path) else: todo.append(path) - # Iterate until both stacks are empty. Whenever the topmost element - # in todo is no longer a subelement of the topmost element of - # fixorder, we handle the fixorder element, otherwise we handle the - # todo element. + # Iterate until both stacks are empty. Whenever the topmost element in + # todo is no longer a subelement of the topmost element of fixorder, we + # handle the fixorder element, otherwise we handle the todo element. try: while todo or fixorder: if fixorder: - # Handle next object on which to fix order unless - # there are still subpaths to be handled + # Handle next object on which to fix order unless there are + # still subpaths to be handled path = fixorder[-1] if not (todo and todo[-1].startswith(path)): self._playback_fixorder(fixorder.pop())