예제 #1
0
	def processFile(self, arg):
		"""Print a cluster of nodes based on a jconf file, and process any links"""
		fullpath, directory, filename = arg
		self.fullPaths.append(fullpath)
		self.lines.append("subgraph cluster_%s {" % sanitize(filename))

		self.lines.append('label = "%s";' % filename)
		self.lines.append('style = "dotted";')

		tree = et.parse(fullpath)
		root = tree.getroot()

		for firstLevel in list(root):
			if firstLevel.tag == ns + "include":
				# recurse into included file
				self.processFile(findInSearchPath(firstLevel.text, [directory]))

			elif firstLevel.tag == ns + "elements":

				for elt in list(firstLevel):
					# Some tags we ignore.
					if elt.tag in [ns + x for x in self.ignoredElements]:
						continue

					# Add nodes for the rest of the elements
					self.addNode(elt)

					# Some nodes contain information on relationships
					# that we want to depict in the graph.
					if elt.tag == ns + "alias":
						self.handleAlias(elt)

					elif elt.tag == ns + "position_proxy":
						self.handleProxy(elt, "Position")

					elif elt.tag == ns + "analog_proxy":
						self.handleProxy(elt, "Analog")

					elif elt.tag == ns + "digital_proxy":
						self.handleProxy(elt, "Digital")

					elif elt.tag == ns + "keyboard_mouse_proxy":
						self.handleProxy(elt)

					elif elt.tag == ns + "user":
						self.handleUser(elt)

					elif elt.tag == ns + "simulated_relative_position":
						self.handleSimulatedRelativePosition(elt)

					elif ns + "simulated" in elt.tag:
						self.handleSimulated(elt)

			else:
				continue



		self.lines.append("}")
예제 #2
0
    def processFile(self, arg):
        """Print a cluster of nodes based on a jconf file, and process any links"""
        fullpath, directory, filename = arg
        self.fullPaths.append(fullpath)
        self.lines.append("subgraph cluster_%s {" % sanitize(filename))

        self.lines.append('label = "%s";' % filename)
        self.lines.append('style = "dotted";')

        tree = et.parse(fullpath)
        root = tree.getroot()

        for firstLevel in list(root):
            if firstLevel.tag == ns + "include":
                # recurse into included file
                self.processFile(findInSearchPath(firstLevel.text,
                                                  [directory]))

            elif firstLevel.tag == ns + "elements":

                for elt in list(firstLevel):
                    # Some tags we ignore.
                    if elt.tag in [ns + x for x in self.ignoredElements]:
                        continue

                    # Add nodes for the rest of the elements
                    self.addNode(elt)

                    # Some nodes contain information on relationships
                    # that we want to depict in the graph.
                    if elt.tag == ns + "alias":
                        self.handleAlias(elt)

                    elif elt.tag == ns + "position_proxy":
                        self.handleProxy(elt, "Position")

                    elif elt.tag == ns + "analog_proxy":
                        self.handleProxy(elt, "Analog")

                    elif elt.tag == ns + "digital_proxy":
                        self.handleProxy(elt, "Digital")

                    elif elt.tag == ns + "keyboard_mouse_proxy":
                        self.handleProxy(elt)

                    elif elt.tag == ns + "user":
                        self.handleUser(elt)

                    elif elt.tag == ns + "simulated_relative_position":
                        self.handleSimulatedRelativePosition(elt)

                    elif ns + "simulated" in elt.tag:
                        self.handleSimulated(elt)

            else:
                continue

        self.lines.append("}")
예제 #3
0
	def processFiles(self, files):
		"""Process all jconf files passed, printing the complete dot output."""

		self.lines.append("digraph {")
		self.lines.append('size="8.5,11"')
		self.lines.append('ratio="compress"')
		for fn in files:
			self.processFile(findInSearchPath(fn))
		self.addUndefinedNodes()
		self.lines.append( "\n".join(self.links))
		self.lines.append("}")
		self.dotcode = "\n".join(self.lines)
예제 #4
0
    def processFiles(self, files):
        """Process all jconf files passed, printing the complete dot output."""

        self.lines.append("digraph {")
        self.lines.append('size="8.5,11"')
        self.lines.append('ratio="compress"')
        for fn in files:
            self.processFile(findInSearchPath(fn))
        self.addUndefinedNodes()
        self.lines.append("\n".join(self.links))
        self.lines.append("}")
        self.dotcode = "\n".join(self.lines)