| Total Complexity | 0 |
| Total Lines | 33 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | """ |
||
| 2 | Playgrounds are scripts where i testing and preparing new things and new futures. |
||
| 3 | |||
| 4 | negation |
||
| 5 | """ |
||
| 6 | |||
| 7 | import graph.oval_graph |
||
| 8 | import graph.xml_parser |
||
| 9 | import json |
||
| 10 | |||
| 11 | tree = graph.oval_graph.OvalNode(1, 'operator', 'and', False, [ |
||
| 12 | graph.oval_graph.OvalNode(2, 'value', 'false', False), |
||
| 13 | graph.oval_graph.OvalNode(3, 'value', 'true', False)]) |
||
| 14 | |||
| 15 | |||
| 16 | print(tree.evaluate_tree()) |
||
| 17 | print(graph.oval_graph.restore_dict_to_tree( |
||
| 18 | tree.save_tree_to_dict()).evaluate_tree()) |
||
| 19 | parser = graph.xml_parser.xml_parser('./data/ssg-fedora-ds-arf.xml') |
||
| 20 | dict = parser.get_rule_dict( |
||
| 21 | 'xccdf_org.ssgproject.content_rule_dconf_gnome_session_idle_user_locks') |
||
| 22 | |||
| 23 | |||
| 24 | oval_tree = graph.oval_graph.build_nodes_form_xml( |
||
| 25 | './data/ssg-fedora-ds-arf.xml', |
||
| 26 | 'xccdf_org.ssgproject.content_rule_dconf_gnome_session_idle_user_locks') |
||
| 27 | with open('./data.json', "w+") as file: |
||
| 28 | file.write( |
||
| 29 | str(json.dumps(oval_tree.save_tree_to_dict(), sort_keys=False, indent=4))) |
||
| 30 | file.write('\n\n') |
||
| 31 | file.write( |
||
| 32 | str(json.dumps(dict, sort_keys=False, indent=4))) |
||
| 33 |