Custom Object to XML Functionality with Tests#1
Open
olaf-c wants to merge 9 commits into
Open
Conversation
cainja
reviewed
Nov 22, 2023
| self.tree_with_children.children[0].children.append(xml_object(name = 'population.process', attribute_dict = {'id':'SIGNALING', 'version':'complex'}, self_closing = True) ) | ||
|
|
||
| print(self) | ||
| print("olaf") |
Member
There was a problem hiding this comment.
make sure these debug print statements get removed before you send to pull request
| self.assertEqual(children_elements[0].attrib, {'id':'DIVISION_POTENTIAL', 'value':'3'}) | ||
|
|
||
| self.assertEqual(children_elements[1].tag, 'population.process') | ||
| self.assertEqual(children_elements[1].attrib, {'id':'METABOLISM', 'version':'complex'}) |
Member
There was a problem hiding this comment.
there are cleaner ways to do this but we don't need to do that now
|
|
||
| current_script_path = os.path.dirname(os.path.abspath(__file__)) | ||
| relative_path_to_xml_object = os.path.normpath(os.path.join(current_script_path, '../../src/')) | ||
| sys.path.append(relative_path_to_xml_object) |
| child_element = child.convert_to_element_tree() | ||
| element.append(child_element) | ||
| return element | ||
| def save_XML(self, file_name): |
Member
There was a problem hiding this comment.
make sure you follow a style guide with spacing the methods
| from typing import List | ||
|
|
||
| @dataclass(frozen=True, order=True) | ||
| class xml_object: |
…essary components in xml_object.py, uncertain how low level it should operate. Should it receive from gui.py strings or xml_objects.
… remade with PyQt Designer or another GUI designer. Functions required for creating final set up .xml located in xml_object.py and compile_xml.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added files: