Skip to content

Commit

Permalink
wip - to remove
Browse files Browse the repository at this point in the history
  • Loading branch information
Seb-sti1 committed Nov 19, 2024
1 parent d290ee3 commit 1545214
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/rmscene/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,33 @@

import sys
import argparse
from . import read_blocks

from . import read_blocks, build_tree, SceneTree
from rmscene import scene_items as si

def parse_args(args):
parser = argparse.ArgumentParser(prog="rmscene")
parser.add_argument("file", type=argparse.FileType("rb"), help="filename to read")
return parser.parse_args(args)


def recursive(item: si.Group):
for child_id in item.children:
child = item.children[child_id]
if isinstance(child, si.Group):
recursive(child)
elif isinstance(child, si.Line):
pass

def pprint_file(args) -> None:
import pprint

result = read_blocks(args.file)
tree = SceneTree()
build_tree(tree, result)


recursive(tree.root)

for el in result:
print()
pprint.pprint(el)
Expand Down

0 comments on commit 1545214

Please sign in to comment.