Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(29)  |  Call(16)  |  Derive(0)  |  Import(13)

        def get_xml_parse(file):
    from xml.dom import minidom

    if os.path.exists(file):
        document = minidom.parse(file)
    else:
        document = minidom.parseString(file)

    return document
        


src/k/a/karesansui-HEAD/karesansui/lib/virt/snapshot.py   karesansui(Download)
import karesansui.lib.locale
 
from karesansui.lib.utils import get_xml_parse        as XMLParse
from karesansui.lib.utils import get_xml_xpath        as XMLXpath
from karesansui.lib.utils import get_nums_xml_xpath   as XMLXpathNum
        if xml is not None:
 
            doc = XMLParse(xml)
            name         = XMLXpath(doc, '/domainsnapshot/name/text()')
            state        = XMLXpath(doc, '/domainsnapshot/state/text()')
            xml = self.getCurrentSnapshotXMLDesc(domain)
            if xml is not False:
                doc = XMLParse(xml)
                retval = XMLXpath(doc, '/domainsnapshot/name/text()')
 
                    if os.path.exists(xml_path):
                        try:
                            doc = XMLParse(xml_path)
                            retval = XMLXpath(doc, '/domain/currentSnapshot/text()')
                        except:
            else: # validate xml file
                try:
                    doc = XMLParse(xmlDesc)
                    name = XMLXpath(doc, '/domainsnapshot/name/text()')
                    if name is not None:

src/k/a/karesansui-HEAD/karesansui/lib/virt/config_storage.py   karesansui(Download)
from karesansui.lib.const import KARESANSUI_GROUP, \
     VIRT_STORAGE_CONFIG_DIR
from karesansui.lib.utils import get_xml_parse        as XMLParse
from karesansui.lib.utils import get_xml_xpath        as XMLXpath
from karesansui.lib.utils import r_chgrp, r_chmod, symlink2real
    def load_xml_config(self,path):
        document = XMLParse(path)
 
        p_type =  XMLXpath(document, '/pool/@type')        
        self.set_pool_type(p_type)
    def load_xml_config(self,path):
        document = XMLParse(path)
 
        name = XMLXpath(document,'/volume/name/text()')
        self.set_storage_name(str(name))

src/k/a/karesansui-HEAD/karesansui/lib/firewall/iptables.py   karesansui(Download)
from karesansui.lib.const import FIREWALL_XML_FILE, \
     FIREWALL_USERCHAIN, RH_USERCHAIN, KARESANSUI_GROUP
from karesansui.lib.utils import get_xml_xpath as XMLXpath, \
     get_xml_parse as XMLParse, get_nums_xml_xpath as XMLXpathNum, \
     execute_command, r_chgrp, is_readable
            raise KaresansuiIpTablesException("no such file: %s" % path)
 
        document = XMLParse(path)
 
        table_num = XMLXpathNum(document,'/firewall/table')

src/k/a/karesansui-HEAD/karesansui/gadget/guest.py   karesansui(Download)
     uri_split, uri_join, dict_search
 
from karesansui.lib.utils import get_xml_parse as XMLParse
from karesansui.lib.utils import get_xml_xpath as XMLXpath
from karesansui.lib.utils import get_nums_xml_xpath as XMLXpathNum

src/k/a/karesansui-HEAD/karesansui/lib/log/config.py   karesansui(Download)
import karesansui
 
from karesansui.lib.utils import get_xml_xpath as XMLXpath, \
     get_nums_xml_xpath as XMLXpathNum, \
     get_xml_parse as XMLParse, \
                "logview.xml not found. path=%s" % str(self.path))
 
        document = XMLParse(self.path)
 
        self.applications = []

src/k/a/karesansui-HEAD/karesansui/lib/service/config.py   karesansui(Download)
import karesansui
 
from karesansui.lib.utils import get_xml_xpath as XMLXpath, \
     get_nums_xml_xpath as XMLXpathNum, \
     get_xml_parse as XMLParse, \
                "service.xml not found. path=%s" % str(self.path))
 
        document = XMLParse(self.path)
 
        self.services = []

src/k/a/karesansui-HEAD/karesansui/lib/virt/config.py   karesansui(Download)
                                 KVM_KARESANSUI_TMP_DIR
 
from karesansui.lib.utils import get_xml_xpath as XMLXpath, \
     get_nums_xml_xpath as XMLXpathNum, \
     get_xml_parse as XMLParse, \
        #    raise KaresansuiConfigParamException("no such file: %s" % path)
 
        document = XMLParse(path)
 
        domain_type = XMLXpath(document,'/domain/@type')

src/k/a/karesansui-HEAD/karesansui/lib/virt/config_export.py   karesansui(Download)
import karesansui
 
from karesansui.lib.utils import get_xml_xpath as XMLXpath, \
     get_nums_xml_xpath as XMLXpathNum, \
     get_xml_parse as XMLParse, \
                "File not found. path=%s" % (str(self.path)))
 
        document = XMLParse(self.path)
 
        uuid    = XMLXpath(document, '/export/@id')

src/k/a/karesansui-HEAD/karesansui/lib/virt/config_capabilities.py   karesansui(Download)
import karesansui
 
from karesansui.lib.utils import get_xml_xpath as XMLXpath, \
     get_nums_xml_xpath as XMLXpathNum, \
     get_xml_parse as XMLParse, \
    def load_xml_config(self,string):
 
        doc = XMLParse(string)
        xpath_prefix = "/capabilities"
 

src/k/a/karesansui-HEAD/karesansui/lib/virt/config_network.py   karesansui(Download)
from karesansui.lib.const import KARESANSUI_GROUP, \
     VIRT_NETWORK_CONFIG_DIR
from karesansui.lib.utils import get_xml_parse        as XMLParse
from karesansui.lib.utils import get_xml_xpath        as XMLXpath
from karesansui.lib.utils import r_chgrp, r_chmod
            raise KaresansuiNetworkConfigParamException("no such file: %s" % path)
 
        document = XMLParse(path)
        uuid = XMLXpath(document,'/network/uuid/text()')
        self.set_uuid(str(uuid))

  1 | 2  Next