Logo Search packages:      
Sourcecode: zope-cmfquickinstallertool version File versions  Download package

def CMFQuickInstallerTool::parser::PropertyParser::parse (   self,
  product_name 
)

parse the properties to a list consisting dictionaries with the property data

Definition at line 94 of file parser.py.

00094                                 :
        """parse the properties to a list consisting dictionaries with the property data"""
        dirpath = expandpath(os.path.join(product_name,'Extensions'))
        xmlpath = os.path.join(dirpath, 'properties')
        if not os.path.exists(xmlpath):
            return None
        
        self.lines=open(xmlpath).readlines()
        for line in self.lines:
            new_line=strip(line)
            if new_line.startswith('<') and not new_line.startswith('</'):
                self.start=self.lineno
            if new_line.startswith('</'):
                self.end=self.lineno
                for data in self.lines[self.start+1:self.end]:
                    property={}
                    item=split(strip(data),'=')
                    property['id']=item[0]
                    if item[2]=='lines':
                        property['value']=split(item[1],',')
                    else:
                        if len(item)>3:
                            property['value']='='.join(item[1:len(item)-1])
                        else:
                            property['value']=item[1]
                    property['type']=item[-1]
                    self.data.append({strip(self.lines[self.start])[1:-1]:property})
            self.lineno=self.lineno+1
        
    def get_data(self):


Generated by  Doxygen 1.6.0   Back to index