def expandoption(self,option,optionvalue,section,buildout,dictlist): """expand section with variables""" newoption = self.expandvar(option,dictlist[0]) if not buildout.has_section(section): buildout.add_section(section) newopts = [] for line in dictlist: #import pdb; pdb.set_trace() newopt = self.expandvar(optionvalue, line) if newopt not in newopts: newopts.append(newopt) newoptionvalue = '\n\t'.join(newopts) buildout.set(section, newoption, newoptionvalue) return buildout
def expandoption(self, option, optionvalue, section, buildout, dictlist): """expand section with variables""" newoption = self.expandvar(option, dictlist[0]) if not buildout.has_section(section): buildout.add_section(section) newopts = [] for line in dictlist: #import pdb; pdb.set_trace() newopt = self.expandvar(optionvalue, line) if newopt not in newopts: newopts.append(newopt) newoptionvalue = '\n\t'.join(newopts) buildout.set(section, newoption, newoptionvalue) return buildout
def expandsection(self,section,config,buildout,keylist,dictlist): """expand section with variables""" newsection = self.expandvar(section,dictlist[0]) if not buildout.has_section(newsection): buildout.add_section(newsection) for option in config.options(section): #import pdb; pdb.set_trace() opt = config.get(section, option) match = self.c_re.search(option) if match: #option name contains a variable newkeys = self.checkkey(option) keydict = self.multikeydict(newkeys,dictlist) for key in keydict.keys(): buildout = self.expandoption(option,opt,newsection,buildout,keydict[key]) else:#eventually right-part contains a variable buildout = self.expandoption(option,opt,newsection,buildout,dictlist) return buildout