diff options
author | Lars Wirzenius <liw@liw.fi> | 2012-02-11 13:50:24 +0000 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2012-02-11 13:50:24 +0000 |
commit | d60e1ad110068c8b1521af8f21a2ea85f88fb19e (patch) | |
tree | c30b1777a51783cbf1feef6e6c1ebc50976a91bd | |
parent | fbe02b0bfdd2924f532d9d90fcbc0dfa7cf49850 (diff) | |
download | unperish-d60e1ad110068c8b1521af8f21a2ea85f88fb19e.tar.gz |
Get per-project settings from global config file, not just project.meta
project.meta should not include settings that are specific to me,
lest they confuse not-me. This makes use of the as_cp method and
other changes in cliapp 0.26.
-rwxr-xr-x | unperish | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -137,6 +137,7 @@ class Unperish(cliapp.Application): def process_args(self, args): self.deduce_unset_settings() self.deduce_vcs() + self.find_project_specific_settings() self.create_build_area() self.already = set() @@ -190,6 +191,15 @@ class Unperish(cliapp.Application): return raise cliapp.AppException('Do not know this VCS, if any.') + def find_project_specific_settings(self): + cp = self.settings.as_cp() + section = 'project %s' % self.upstream_name + if cp.has_section(section): + for option in cp.options(section): + if cp.has_option('config', option): + value = cp.get(section, option) + self.settings.set_from_raw_string(option, value) + def create_build_area(self): if not os.path.exists(self.settings['build-area']): os.mkdir(self.settings['build-area']) |