From b2b3e77a342bd9b217f560cb9d5b05bc18209d5f Mon Sep 17 00:00:00 2001 From: Greg Gauthier Date: Wed, 17 Jul 2024 22:43:56 +0100 Subject: [PATCH] minor tweaks --- examples.py | 9 ++++++--- pseudodb/pseudodb.py | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/examples.py b/examples.py index 4398aa8..7dc2842 100644 --- a/examples.py +++ b/examples.py @@ -6,11 +6,14 @@ from utils.misc_utils import immutable_to_list if __name__ == '__main__': db = pseudodb.PseudoDB('pseudodb.default.data') - print("Collections in Pseudodb: "+str(db.data_list())) - for collection in db.data_list(): + data_collections = db.data_collections() + print("Collections in Pseudodb: "+str(data_collections)) + for collection in data_collections: print("Collection: "+collection) for key in db.get_keys(collection): - print(key+": "+str(db.get_values(collection, key))) + print("\t"+key+": "+str(db.get_values(collection, key))) + + print() immutable_list = ('one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine') print("Immutable: "+str(immutable_list)) diff --git a/pseudodb/pseudodb.py b/pseudodb/pseudodb.py index fad60f8..68bdb51 100644 --- a/pseudodb/pseudodb.py +++ b/pseudodb/pseudodb.py @@ -15,7 +15,7 @@ class PseudoDB: print(f"Data module '{module_name}' not found.") return None - def data_list(self): + def data_collections(self): # Check if default has been successfully loaded if self.data is not None: attr_names = []