This commit is contained in:
Jamie Hardt
2024-11-25 10:30:02 -08:00
parent 36e4a02ab8
commit ac37c14b3d

View File

@@ -56,7 +56,7 @@ class MetaBrowser(Cmd):
print(f" - {key}: List ({len(val)} keys)") print(f" - {key}: List ({len(val)} keys)")
elif isinstance(val, bytes): elif isinstance(val, bytes):
print(f" - {key}: ({len(val)} bytes)") print(f" - {key}: ({len(val)} bytes)")
elif val == None: elif val is None:
print(f" - {key}: (NO VALUE)") print(f" - {key}: (NO VALUE)")
else: else:
print(f" - {key}: Unknown") print(f" - {key}: Unknown")
@@ -66,17 +66,17 @@ class MetaBrowser(Cmd):
root = self.cwd root = self.cwd
if isinstance(root, list): if isinstance(root, list):
print(f"List:") print("List:")
for i in range(len(root)): for i in range(len(root)):
self.print_value(root, i) self.print_value(root, i)
elif isinstance(root, dict): elif isinstance(root, dict):
print(f"Dictionary:") print("Dictionary:")
for key in root: for key in root:
self.print_value(root, key) self.print_value(root, key)
else: else:
print(f"Cannot print node, is not a list or dictionary.") print("Cannot print node, is not a list or dictionary.")
def do_cd(self, args): def do_cd(self, args):
'Switch to a different node: CD node-name | ".."' 'Switch to a different node: CD node-name | ".."'
@@ -174,6 +174,5 @@ def main():
cli.cmdloop() cli.cmdloop()
if __name__ == "__main__": if __name__ == "__main__":
main() main()