Changeset 612 in tailor


Ignore:
Timestamp:
08/17/05 19:43:15 (8 years ago)
Author:
lele@…
Hash name:
20050817174315-97f81-77122dd79cffc2e1849f2777a3f544853e4e108c
Message:

Pass vars to ConfigParser?.get() to override defaults with project's settings

Location:
vcpx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • vcpx/config.py

    r603 r612  
    5454        return defaultp or [s for s in self.sections() if not ':' in s] 
    5555 
    56     def get(self, section, option, default=None): 
     56    def get(self, section, option, default=None, vars=None): 
    5757        """ 
    5858        Return the requested option value if present, otherwise the default. 
    5959        """ 
    60         if self.has_option(section, option): 
    61             value = SafeConfigParser.get(self, section, option) 
     60 
     61        if self.has_option(section, option) or (vars and option in vars): 
     62            value = SafeConfigParser.get(self, section, option, vars=vars) 
    6263            if value == 'None': 
    6364                return default 
  • vcpx/repository.py

    r552 r612  
    5050                      config.get(self.name, '%s-module' % which) 
    5151        self.rootdir = config.get(self.name, 'root-directory', 
    52                                   self.project.rootdir) 
    53         self.subdir = config.get(self.name, 'subdir', self.project.subdir) 
     52                                  vars={'root-directory': self.project.rootdir}) 
     53        self.subdir = config.get(self.name, 'subdir', 
     54                                 vars={'subdir': self.project.subdir}) 
    5455 
    5556    def _validateConfiguration(self): 
Note: See TracChangeset for help on using the changeset viewer.