xmlbuilder: Update XMLProperty docs

This commit is contained in:
Cole Robinson 2016-07-18 12:46:59 -04:00
parent fb6548d344
commit d8a0a78805

View File

@ -340,15 +340,16 @@ class XMLProperty(property):
is_bool=False, is_int=False, is_yesno=False, is_onoff=False, is_bool=False, is_int=False, is_yesno=False, is_onoff=False,
default_cb=None, default_name=None, do_abspath=False): default_cb=None, default_name=None, do_abspath=False):
""" """
Set a XMLBuilder class property that represents a value in the Set a XMLBuilder class property that maps to a value in an XML
<domain> XML. For example document, indicated by the passed xpath. For example, for a
<domain><name> the definition may look like:
name = XMLProperty(get_name, set_name, xpath="/domain/name") name = XMLProperty("./name")
When building XML from scratch (virt-install), name is a regular When building XML from scratch (virt-install), 'name' works
class property. When parsing and editting existing guest XML, we similar to a regular class property(). When parsing and editing
use the xpath value to map the name property to the underlying XML existing guest XML, we use the xpath value to get/set the value
definition. in the parsed XML document.
@param doc: option doc string for the property @param doc: option doc string for the property
@param xpath: xpath string which maps to the associated property @param xpath: xpath string which maps to the associated property