wizardofzos / pyracf

RACF parsing for the rest of us...
Apache License 2.0
6 stars 8 forks source link

different ways to access the grouptree/ownertree #28

Closed rob-vh closed 5 months ago

rob-vh commented 5 months ago

When you issue r.ownertree in ipython, you acually get r.ownertree.__repr__(). This prints {} because

rob-vh commented 5 months ago

I could fix this by calling super().__init__(tree) to load the tree-dict into the real dict, instead of the .tree attribute. Then:

Now... do I need 2 methods to specify the format, or not?

rob-vh commented 5 months ago

https://github.com/wizardofzos/pyracf/pull/29/commits/f8b5c2ad774e86b1ca62a5bd8d44e81ee73e3ee6 r.ownergroup now returns the raw dict of the tree. The .tree attribute is deleted. r.ownergroup.setformat(format='simple') no longer returns the formatted tree, it only sets the default format for the next print(r.ownertree) command. new method r.ownertree.format() returns the formatted tree, same as produced by print(r.ownertree). Optional parameter format={'unix', 'simple'}