Skip to content

Commit

Permalink
flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
iluvcapra committed Nov 25, 2024
1 parent 36e4a02 commit ac37c14
Showing 1 changed file with 19 additions and 20 deletions.
39 changes: 19 additions & 20 deletions wavinfo/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,38 +45,38 @@ def cwd(self):

@staticmethod
def print_value(collection, key):
val = collection[key]
if isinstance(val, int):
print(f" - {key}: {val}")
elif isinstance(val, str):
print(f" - {key}: \"{val}\"")
elif isinstance(val, dict):
print(f" - {key}: Dict ({len(val)} keys)")
elif isinstance(val, list):
print(f" - {key}: List ({len(val)} keys)")
elif isinstance(val, bytes):
print(f" - {key}: ({len(val)} bytes)")
elif val == None:
print(f" - {key}: (NO VALUE)")
else:
print(f" - {key}: Unknown")
val = collection[key]
if isinstance(val, int):
print(f" - {key}: {val}")
elif isinstance(val, str):
print(f" - {key}: \"{val}\"")
elif isinstance(val, dict):
print(f" - {key}: Dict ({len(val)} keys)")
elif isinstance(val, list):
print(f" - {key}: List ({len(val)} keys)")
elif isinstance(val, bytes):
print(f" - {key}: ({len(val)} bytes)")
elif val is None:
print(f" - {key}: (NO VALUE)")
else:
print(f" - {key}: Unknown")

def do_ls(self, _):
'List items at the current node: LS'
root = self.cwd
root = self.cwd

if isinstance(root, list):
print(f"List:")
print("List:")
for i in range(len(root)):
self.print_value(root, i)

elif isinstance(root, dict):
print(f"Dictionary:")
print("Dictionary:")
for key in root:
self.print_value(root, key)

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):
'Switch to a different node: CD node-name | ".."'
Expand Down Expand Up @@ -174,6 +174,5 @@ def main():
cli.cmdloop()



if __name__ == "__main__":
main()

0 comments on commit ac37c14

Please sign in to comment.