6,566
edits
m (→All subsystems: Changed the order.) |
(→Script: Newest version of the script.) |
||
Line 328: | Line 328: | ||
# XML start. | # XML start. | ||
if self.xml: | if self.xml: | ||
print("<?xml version=\"1.0\"?>") | |||
print("<subsystems>") | print("<subsystems>") | ||
Line 356: | Line 357: | ||
# Subsystems. | # Subsystems. | ||
for subsystem in subsystem_list: | for subsystem in subsystem_list: | ||
print(" %s" % ( | for line in repr(subsystem).split("\n"): | ||
print(" %s" % (line)) | |||
# End. | # End. | ||
Line 447: | Line 449: | ||
@rtype: str | @rtype: str | ||
""" | """ | ||
# The inheritance chain. | # The inheritance chain. | ||
inheritance = "" | |||
if self.base_class: | if self.base_class: | ||
inheritance += "%s" % self.base_class.name | |||
if self.base_class.base_class: | if self.base_class.base_class: | ||
inheritance += " : %s" % self.base_class.base_class.name | |||
if self.base_class.base_class.base_class: | if self.base_class.base_class.base_class: | ||
inheritance += " : %s" % self.base_class.base_class.base_class.name | |||
if self.base_class.base_class.base_class.base_class: | if self.base_class.base_class.base_class.base_class: | ||
inheritance += " : %s" % self.base_class.base_class.base_class.base_class.name | |||
if self.base_class.base_class.base_class.base_class.base_class: | if self.base_class.base_class.base_class.base_class.base_class: | ||
inheritance += " : %s" % self.base_class.base_class.base_class.base_class.base_class.name | |||
# XML representation. | |||
if self.xml: | |||
return self.__repr_xml__(inheritance) | |||
# The subsystem name and inheritance chain. | |||
string = "<%s : %s" % (self.name, inheritance) | |||
# Add the declaration file name. | # Add the declaration file name. | ||
string += " declared in \"%s\"" % self.declaration_file | |||
# Add the implementation file name. | # Add the implementation file name. | ||
if self.implementation_file: | if self.implementation_file: | ||
string += ", implemented in \"%s\"" % self.implementation_file | |||
# Closure. | # Closure. | ||
string += ">" | string += ">" | ||
# Return the representation. | # Return the representation. | ||
return string | |||
def __repr_xml__(self, inheritance=""): | |||
"""Create a XML representation of the object. | |||
@keyword inheritance: The string representation of the inheritance chain. | |||
@type inheritance: str | |||
@return: The XML representation. | |||
@rtype: str | |||
""" | |||
# Start. | |||
string = "<%s>\n" % self.name | |||
# The inheritance chain. | |||
string += " <inheritance>%s</inheritance>\n" % inheritance | |||
# Add the declaration file name. | |||
string += " <declaration>%s</declaration>\n" % self.declaration_file | |||
# Add the implementation file name. | |||
if self.implementation_file: | |||
string += " <implementation>%s</implementation>\n" % self.implementation_file | |||
# End. | |||
string += "</%s>" % self.name | |||
# Return the string. | |||
return string | return string | ||