当前位置: 首页>>代码示例>>Python>>正文


Python wrapperxml.WrapperXml类代码示例

本文整理汇总了Python中periphondemand.bin.utils.wrapperxml.WrapperXml的典型用法代码示例。如果您正苦于以下问题:Python WrapperXml类的具体用法?Python WrapperXml怎么用?Python WrapperXml使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了WrapperXml类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

 def __init__(self, parent):
     self.parent = parent
     filepath = self.parent.projectpath + "/" +\
         SIMULATIONPATH + "/simulation" + XMLEXT
     if not sy.file_exist(filepath):
         raise PodError("No simulation project found", 3)
     WrapperXml.__init__(self, file=filepath)
开发者ID:Martoni,项目名称:periphondemand,代码行数:7,代码来源:simulation.py

示例2: __init__

 def __init__(self,project):
     self.project = project
     filepath = settings.projectpath+"/"+DRIVERSPATH+"/drivers"+XMLEXT
     if not sy.fileExist(filepath):
         raise Error("No driver project found",3)
     WrapperXml.__init__(self,file=filepath)
     self.bspdir = None
开发者ID:magyarm,项目名称:periphondemand-code,代码行数:7,代码来源:driver.py

示例3: loadInstance

    def loadInstance(self,instancename):
        """ Load an instance from project directory
        """
        # load xml file
        WrapperXml.__init__(self,file=settings.projectpath + COMPONENTSPATH +"/"\
                + instancename + "/" + instancename + XMLEXT)

        # Fill objects list
        if self.getNode("interfaces") != None:
            for element in self.getSubNodeList("interfaces","interface"):
                self.interfaceslist.append(Interface(self,node=element))

        if self.getNode("generics") != None:
            for element in self.getSubNodeList("generics","generic"):
                self.genericslist.append(Generic(self,node=element))

        if self.getNode("hdl_files")!= None:
            for element in self.getSubNodeList("hdl_files","hdl_file"):
                self.hdl_fileslist.append(Hdl_file(self,node=element))

        if self.getNode("driver_files")!=None:
            for element in self.getSubNodeList("driver_files","driver_templates"):
                self.driver_templateslist.append(Driver_Templates(self,node=element))

        if self.getNode("interrupts")!=None:
            for element in self.getSubNodeList("interrupts","interrupt"):
                self.interruptslist.append(
                        self.getInterface(
                            element.getAttributeValue("interface")).getPort(
                                element.getAttributeValue("port")))

        self.setInstanceName(instancename)
开发者ID:magyarm,项目名称:periphondemand-code,代码行数:32,代码来源:component.py

示例4: __init__

 def __init__(self,parent):
     self.parent = parent
     filepath = settings.projectpath+"/"+SYNTHESISPATH+"/synthesis"+XMLEXT
     if not sy.fileExist(filepath):
         raise Error("No synthesis project found",3)
     WrapperXml.__init__(self,file=filepath)
     # adding path for toolchain plugin
     sys.path.append(settings.path+TOOLCHAINPATH+\
             SYNTHESISPATH+"/"+self.getName())
开发者ID:xcthulhu,项目名称:periphondemand,代码行数:9,代码来源:synthesis.py

示例5: __init__

 def __init__(self, parent, **keys):
     """ init driver_templates,
         __init__(self,parent,node)
         __init__(self,parent,nodestring)
     """
     self.parent = parent
     if "node" in keys:
         WrapperXml.__init__(self, node=keys["node"])
     elif "nodestring" in keys:
         WrapperXml.__init__(self, nodestring=keys["nodestring"])
     else:
         raise PodError("Keys unknown in DriverTemplates init()", 0)
开发者ID:Martoni,项目名称:periphondemand,代码行数:12,代码来源:driver_templates.py

示例6: __init__

 def __init__(self, parent, **keys):
     """ init Generic,
         __init__(self,parent,node)
         __init__(self,parent,nodestring)
     """
     self.parent = parent
     if "node" in keys:
         WrapperXml.__init__(self, node=keys["node"])
     elif "nodestring" in keys:
         WrapperXml.__init__(self, nodestring=keys["nodestring"])
     else:
         raise PodError("Keys unknown in SimulationLib init()", 0)
开发者ID:trabucayre,项目名称:periphondemand,代码行数:12,代码来源:simulationlib.py

示例7: __init__

 def __init__(self,filename):
     self.filename = os.path.expanduser(filename)
     if os.path.exists(self.filename):
         WrapperXml.__init__(self,file=self.filename)
     else:
         print filename + " doesn't exist, be created"
         WrapperXml.__init__(self,nodename="podconfig")
         self.addNode(nodename="libraries")
         self.savefile()
     # fill library path list:
     self.personal_lib_list =\
         [node.getAttribute("path") 
                 for node in self.getSubNodeList("libraries","lib")]
开发者ID:xcthulhu,项目名称:periphondemand,代码行数:13,代码来源:configfile.py

示例8: __init__

 def __init__(self, parent, **keys):
     """ init Slave,
         __init__(self,parent,node)
         __init__(self,parent,instancename,interfacename)
     """
     self.parent = parent
     if "node" in keys:
         WrapperXml.__init__(self, node=keys["node"])
     elif "instancename" in keys:
         WrapperXml.__init__(self, nodename="slave")
         self.instancename = keys["instancename"]
         self.interfacename = keys["interfacename"]
     else:
         raise PodError("Keys unknowns in Slave init()", 0)
开发者ID:Martoni,项目名称:periphondemand,代码行数:14,代码来源:slave.py

示例9: __init__

 def __init__(self,parent,**keys):
     """ Init Hdl_file,
         __init__(self,parent,node)
         __init__(self,filename,istop,scope)
     """
     self.parent = parent
     self.parser = None
     if "node" in keys:
         WrapperXml.__init__(self,node=keys["node"])
     elif "filename" in keys:
         self.__initfilename(filename=keys["filename"],
                             istop=keys["istop"],scope=keys["scope"])
     else:
         raise Error("Keys unknown in Hdl_file",0)
开发者ID:xcthulhu,项目名称:periphondemand,代码行数:14,代码来源:hdl_file.py

示例10: __init__

    def __init__(self, parent, **keys):
        """ init Pin,
            __init__(self,parent,node)
            __init__(self,parent,num)
        """

        self.parent = parent

        if "node" in keys:
            WrapperXml.__init__(self, node=keys["node"])
        elif "num" in keys:
            WrapperXml.__init__(self, nodename="pin")
            self.num = keys["num"]
        else:
            raise PodError("Keys unknown in Pin", 0)
开发者ID:Martoni,项目名称:periphondemand,代码行数:15,代码来源:pin.py

示例11: __init__

    def __init__(self, parent, **keys):
        """ Init HdlFile,
            __init__(self, parent, node)
            __init__(self, filename, istop, scope)
        """
        self.parent = parent
        self.parser = None
        if "node" in keys:
            WrapperXml.__init__(self,
                                node=keys["node"])

        elif "filename" in keys:
            WrapperXml.__init__(self, nodename="hdl_file")
            if keys["istop"] == 1:
                self.settop()
            self.scope = keys["scope"]
            self.filename = keys["filename"]
        else:
            raise PodError("Keys unknown in HdlFile", 0)
开发者ID:Martoni,项目名称:periphondemand,代码行数:19,代码来源:hdl_file.py

示例12: __init__

    def __init__(self, parent, **keys):
        """ Init port,
            __init__(self, parent, name)
            __init__(self, parent, wxml)
        """

        self.parent = parent

        if "name" in keys:
            WrapperXml.__init__(self, nodename="port")
            self.set_attr("name", keys["name"])
        elif "node" in keys:
            WrapperXml.__init__(self, node=keys["node"])
        else:
            raise PodError("Keys not known in Port ", 0)

        self.pinlist = []
        for element in self.get_nodes("pin"):
            pin = Pin(self, node=element)
            self.pinlist.append(pin)
开发者ID:Martoni,项目名称:periphondemand,代码行数:20,代码来源:port.py

示例13: load

    def load(self, instancename):
        """ Load an instance from project directory
        """
        # load xml file
        WrapperXml.__init__(self, file=self.parent.projectpath +
                            COMPONENTSPATH + "/" + instancename +
                            "/" + instancename + XMLEXT)

        # Fill objects list
        if self.get_node("interfaces") is not None:
            for element in self.get_subnodes("interfaces", "interface"):
                self._interfaceslist.append(Interface(self, node=element))

        if self.get_node("generics") is not None:
            for element in self.get_subnodes("generics", "generic"):
                self._genericslist.append(Generic(self, node=element))

        if self.get_node("hdl_files") is not None:
            for element in self.get_subnodes("hdl_files", "hdl_file"):
                self._hdl_fileslist.append(HdlFile(self, node=element))

        if self.get_node("driver_files") is not None:
            for element in\
                    self.get_subnodes("driver_files", "driver_templates"):
                self._driver_templateslist.append(
                    DriverTemplates(self, node=element))

        if self.get_node("interrupts") is not None:
            for element in self.get_subnodes("interrupts", "interrupt"):
                self._interruptslist.append(
                    self.get_interface(
                        element.get_attr_value("interface")).get_port(
                            element.get_attr_value("port")))

        if self.get_node("constraints") is not None:
            for element in self.get_subnodes("constraints", "constraint"):
                self._constraintslist.append(element)

        self.instancename = instancename
开发者ID:Martoni,项目名称:periphondemand,代码行数:39,代码来源:component.py

示例14: createComponent

 def createComponent(self,componentname,libraryname,versionname):
     """ Creating new component 'componentname' for 
         library 'libraryname'
     """
     librarypath = settings.active_library.getLibraryPath(libraryname)
     componentpath = os.path.join(librarypath,componentname)
     # verify if component and version exist
     if sy.fileExist(os.path.join(componentpath,versionname+XMLEXT)):
             settings.active_component = None
             raise Error("Component version "+componentname+"."+versionname+\
                         " already exist")
     # make directories if component is really new
     if not sy.dirExist(componentpath):
         sy.makeDirectory(componentpath)
         sy.makeDirectory(os.path.join(componentpath,"hdl"))
         sy.makeDirectory(os.path.join(componentpath,"doc"))
         sy.makeDirectory(os.path.join(componentpath,"drivers_templates"))
     
     # create xml file
     WrapperXml.__init__(self,nodename="component")
     self.setName(componentname)
     self.saveComponent(os.path.join(componentpath,versionname))
     self.setVersionName(versionname)
开发者ID:xcthulhu,项目名称:periphondemand,代码行数:23,代码来源:component.py

示例15: __init__

    def __init__(self, projectpathname, void=0,
                 description="insert a description here"):
        """ create project if doesn't exist
        """
        self.void = void
        WrapperXml.__init__(self, nodename="void")
        self._instanceslist = []
        self._vhdl_version = "vhdl87"

        self.simulation = None
        self.synthesis = None
        self.driver = None

        self._library = Library(self)

        self.bspdir = None
        self.bspos = None
        if not self.void:
            if projectpathname.find(XMLEXT) >= 0:
                try:
                    self._projectpath =\
                        os.path.abspath(os.path.dirname(projectpathname))
                except IOError as error:
                    raise PodError(str(error), 0)
            else:
                self._projectpath = projectpathname
            SETTINGS.projectpath = self.projectpath
            SETTINGS.author = ""
            SETTINGS.active_project = self
            name = os.path.basename(projectpathname)
            if sy.file_exist(projectpathname):
                self.load_project(projectpathname)
            else:
                self.create_project(name)
            self.description = description

            SETTINGS.active_project = self
开发者ID:Martoni,项目名称:periphondemand,代码行数:37,代码来源:project.py


注:本文中的periphondemand.bin.utils.wrapperxml.WrapperXml类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。