diff roundup/backends/back_anydbm.py @ 7008:f92c56e74f82

in clear() clear journals and node files. AFAICT clear() is never called by current codebase, but this fixes a flake8 issue where the loop variable (renamed to data_type) was unused within loop. Also this triggerd a look at Database.clear() in rdbms_common.py which was not clearing the journals.
author John Rouillard <rouilj@ieee.org>
date Fri, 07 Oct 2022 13:18:01 -0400
parents 11e2b0b1cc71
children 8e19c390e88c
line wrap: on
line diff
--- a/roundup/backends/back_anydbm.py	Fri Oct 07 13:15:33 2022 -0400
+++ b/roundup/backends/back_anydbm.py	Fri Oct 07 13:18:01 2022 -0400
@@ -239,8 +239,8 @@
         """
         logging.getLogger('roundup.hyperdb.backend').info('clear')
         for cn in self.classes:
-            for dummy in 'nodes', 'journals':
-                path = os.path.join(self.dir, 'journals.%s' % cn)
+            for data_type in 'nodes', 'journals':
+                path = os.path.join(self.dir, '%s.%s' % (data_type, cn))
                 if os.path.exists(path):
                     os.remove(path)
                 elif os.path.exists(path+'.db'):    # dbm appends .db

Roundup Issue Tracker: http://roundup-tracker.org/