Skip to content

Commit

Permalink
fix: -M & -D flags were printing more than they were supposed to
Browse files Browse the repository at this point in the history
  • Loading branch information
aidenlangley committed Jan 26, 2022
1 parent 379ed89 commit b35c09a
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions src/bspcq/bspcq.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from rich.tree import Tree
from subprocess import run as run_sys
from typing import Any
# from configparser import ConfigParser


def config() -> ArgumentParser:
argparser = ArgumentParser(
Expand Down Expand Up @@ -57,14 +57,6 @@ def config() -> ArgumentParser:
help="print a simplified view of the BSP tree."
)

# Read in the version from `setup.cfg`.
# cfg = ConfigParser()
# cfg.read('setup.cfg')
# argparser.add_argument(
# '--version', action='version',
# version=cfg.get('metadata', 'version')
# )

return argparser


Expand Down Expand Up @@ -100,18 +92,24 @@ def run() -> None:
for tree in bsp_trees:
print(analyze_monitor(tree, args.simple)[1])

return

if args.desktops:
for tree in bsp_trees:
desktops = analyze_monitor(tree, args.simple)[0]
for desktop_tree in desktops:
print(analyze_desktop(desktop_tree, args.simple)[1])

return

if args.nodes:
if args.node:
for tree in bsp_trees:
for node_tree in analyze_nodes(tree, args.simple)[1]:
print(node_tree)

return

elif args.desktop:
for tree in bsp_trees:

Expand All @@ -120,6 +118,8 @@ def run() -> None:
for node_tree in analyze_nodes(nodes, args.simple)[1]:
print(node_tree)

return

else:
for tree in bsp_trees:
desktops = analyze_monitor(tree, args.simple)[0]
Expand All @@ -130,7 +130,7 @@ def run() -> None:
for node_tree in analyze_nodes(nodes, args.simple)[1]:
print(node_tree)

return
return

else:
for bsp_tree in bsp_trees:
Expand Down Expand Up @@ -330,3 +330,6 @@ def format_val(val: Any) -> str:

def make_tree(label: str, bsp_tree: dict[str, Any], simple: bool) -> Tree:
return Tree(label) if simple else traverse_tree(bsp_tree, Tree(label))


run()

0 comments on commit b35c09a

Please sign in to comment.