Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed vizoozie to display ok and error nodes. #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions vizoozie/vizoozie.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ def getOK(self, node):
ok = node.getElementsByTagName("ok")[0]
return ok

def getError(self, node):
error = node.getElementsByTagName("error")[0]
return error

def processHeader(self, name):
output = "digraph{\nsize = \"8,8\";ratio=fill;node[fontsize=24];labelloc=\"t\";label=\"" + name + "\";\n"
return output
Expand All @@ -52,8 +56,11 @@ def processAction(self, doc):
break
ok = self.getOK(node)
to = self.getTo(ok)
error = self.getError(node)
to_error = self.getTo(error)
output += '\n'+name.replace('-', '_') + " [shape=box,style=filled,color=" + color + "];\n"
output += '\n'+name.replace('-', '_') + " -> " + to.replace('-', '_') + ";\n"
output += '\n'+name.replace('-', '_') + " -> " + to.replace('-', '_') + "[style=bold,label=\"ok\",fontsize=20];\n"
output += '\n'+name.replace('-', '_') + " -> " + to_error.replace('-', '_') + "[style=dotted,label=\"error\",fontsize=20];\n"
return output

def processFork(self, doc):
Expand Down Expand Up @@ -85,7 +92,7 @@ def processDecision(self, doc):
output += '\n' + name.replace('-', '_') + " [shape=diamond];\n"
for case in switch.getElementsByTagName("case"):
to = case.getAttribute("to")
caseValue = case.childNodes[0].nodeValue.replace('"', '')
caseValue = case.childNodes[0].nodeValue.replace("\n",'').replace('"', '')
output += '\n' + name.replace('-', '_') + " -> " + to.replace('-', '_') + "[style=bold,label=\"" + caseValue + "\",fontsize=20];\n"

default = switch.getElementsByTagName("default")[0]
Expand Down Expand Up @@ -125,4 +132,4 @@ def main():


if __name__ == "__main__":
main()
main()