Skip to content

Commit

Permalink
I changed some stuff.
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Feb 1, 2017
1 parent 56a67e8 commit 4027cab
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
File renamed without changes.
File renamed without changes.
20 changes: 20 additions & 0 deletions src/PIA/Rockwell/XML/Templates/Tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,26 @@ def __init__(self, TagName, DataType, TagType = "Base", Description = "", Radix
self.setDescription(Description)
self.root.append(self.Desc)

def checkIfChild(self, nodeTag):
assert type(nodeTag) == str
for node in self.root:
if node.tag == NodeTag: return False
return True

def addComment(self, comment, specifier):
assert type(comment) == str and type(specifier) == str
if not self.checkIfChild("Comments"):
self.Comments = etree.SubElement(self.root, "Comments")

node = etree.SubElement(self.Comments, "Comment")
checkExists = False
for elem in self.Comments:
if specifier == elem["Operand"]: checkExists = True

if checkExists:

self.Datatypes.append(Datatype)

def setUsage(self, Usage):
assert Usage == "Input" or Usage == "Output" or Usage == "InOut" or Usage == "Public"
self.root.set("Usage", Usage)
Expand Down

0 comments on commit 4027cab

Please sign in to comment.