more tweaking
This commit is contained in:
parent
b2b3e77a34
commit
11338ebf7c
@ -6,7 +6,7 @@ from utils.misc_utils import immutable_to_list
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
db = pseudodb.PseudoDB('pseudodb.default.data')
|
db = pseudodb.PseudoDB('pseudodb.default.data')
|
||||||
data_collections = db.data_collections()
|
data_collections = db.get_collections()
|
||||||
print("Collections in Pseudodb: "+str(data_collections))
|
print("Collections in Pseudodb: "+str(data_collections))
|
||||||
for collection in data_collections:
|
for collection in data_collections:
|
||||||
print("Collection: "+collection)
|
print("Collection: "+collection)
|
||||||
|
@ -15,7 +15,7 @@ class PseudoDB:
|
|||||||
print(f"Data module '{module_name}' not found.")
|
print(f"Data module '{module_name}' not found.")
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def data_collections(self):
|
def get_collections(self):
|
||||||
# Check if default has been successfully loaded
|
# Check if default has been successfully loaded
|
||||||
if self.data is not None:
|
if self.data is not None:
|
||||||
attr_names = []
|
attr_names = []
|
||||||
@ -26,12 +26,6 @@ class PseudoDB:
|
|||||||
else:
|
else:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
def collections(self, attr_name):
|
|
||||||
if self.data is not None:
|
|
||||||
return getattr(self.data, attr_name)
|
|
||||||
else:
|
|
||||||
return None
|
|
||||||
|
|
||||||
def get_keys(self, attr_name):
|
def get_keys(self, attr_name):
|
||||||
if self.data is not None:
|
if self.data is not None:
|
||||||
collection = getattr(self.data, attr_name)
|
collection = getattr(self.data, attr_name)
|
||||||
|
Loading…
Reference in New Issue
Block a user