|
Makeprojects
|
Visual Studio 2003-2008 XML formatter. More...

Public Member Functions | |
| __init__ (self, name, attributes=None, force_pair=False) | |
| Set the defaults. | |
| add_attribute (self, attribute) | |
| Add an attribute object. | |
| add_attributes (self, attributes) | |
| Add a list of attribute objects. | |
| add_element (self, element) | |
| Add an element to this XML element. | |
| set_attribute (self, name, value) | |
| Change existing attribute. | |
| remove_attribute (self, name) | |
| Remove an attribute. | |
| reset_attribute (self, name) | |
| Reset an attribute to default. | |
| generate (self, line_list=None, indent=0, ide=None) | |
| Generate the text lines for this XML element. | |
| __repr__ (self) | |
| Convert the solution record into a human readable description. | |
| __str__ (self) | |
| Convert the solultion record into a human readable description. | |
Visual Studio 2003-2008 XML formatter.
Output XML elements in the format of Visual Studio 2003-2008.
Visual Studio 2003-2008 only supports XML tags and attributes. There is no support for text between tags.
Theses are examples of XML fragments this class exports.
| makeprojects.visual_studio.VS2003XML.__init__ | ( | self, | |
| name, | |||
| attributes = None, | |||
| force_pair = False ) |
Set the defaults.
| name | Name of the XML element |
| attributes | dict of attributes to use as defaults. |
| force_pair | If True, disable the use of /> XML suffix usage. |
| makeprojects.visual_studio.VS2003XML.__repr__ | ( | self | ) |
Convert the solution record into a human readable description.
| makeprojects.visual_studio.VS2003XML.__str__ | ( | self | ) |
Convert the solultion record into a human readable description.
| makeprojects.visual_studio.VS2003XML.add_attribute | ( | self, | |
| attribute ) |
Add an attribute object.
Append the passed attribute to the end of the attribute list for this XML element.
| attribute | A validator class instance |
| makeprojects.visual_studio.VS2003XML.add_attributes | ( | self, | |
| attributes ) |
Add a list of attribute objects.
Iterate over the list of attribute objects and append them to the end of the attribute list.
| attributes | list of attribute objects. |
| makeprojects.visual_studio.VS2003XML.add_element | ( | self, | |
| element ) |
Add an element to this XML element.
| element | VS2003XML object |
| makeprojects.visual_studio.VS2003XML.generate | ( | self, | |
| line_list = None, | |||
| indent = 0, | |||
| ide = None ) |
Generate the text lines for this XML element.
There is a slight difference between Visual Studio 2003 and 2005/2008 on how tags are closed. The argument ide is used to flag with close format to use.
| line_list | list object to have text lines appended to |
| indent | number of tabs to insert (For recursion) |
| ide | IDE to target. |
Reimplemented in makeprojects.visual_studio.VS2003vcproj.
| makeprojects.visual_studio.VS2003XML.remove_attribute | ( | self, | |
| name ) |
Remove an attribute.
If the value is in the list, remove it.
| name | String of the entry to remove |
| makeprojects.visual_studio.VS2003XML.reset_attribute | ( | self, | |
| name ) |
Reset an attribute to default.
If the attribute is in the attribute_defaults list, set it to the default, which can include the attribute removal.
| name | String of the entry to reset |
| makeprojects.visual_studio.VS2003XML.set_attribute | ( | self, | |
| name, | |||
| value ) |
Change existing attribute.
If the attribute was not found, it will throw.
| name | String of the entry to match |
| value | Value to substitute |