def load(self): """ load - override load hook to read the users .gitconfig file """ if self.gitconfig_file is None: self.gitconfig_file = os.path.join(os.environ['HOME'], '.gitconfig') self.config = load_gitconfig(self.gitconfig_file)
def setup_load(self): if self.gitconfig_file is None: self.gitconfig_file = os.path.join(os.environ['HOME'], '.gitconfig') self.gitconfig = load_gitconfig(self.gitconfig_file) self.gitconfig.add_section('cirrus') self._load_creds_plugin()
def load(self): """ _load_from_file_ Reread the cirrus config file """ self.parser = ConfigParser.RawConfigParser() self.parser.read(self.config_file) for section in self.parser.sections(): self.setdefault(section, {}) for option in self.parser.options(section): self[section].setdefault(option, self.parser.get(section, option)) if self.gitconfig_file is None: self.gitconfig_file = os.path.join(os.environ['HOME'], '.gitconfig') self.gitconfig = load_gitconfig(self.gitconfig_file) self._load_creds_plugin()
def load(self): """ _load_from_file_ Reread the cirrus config file """ self.parser = ConfigParser.RawConfigParser() self.parser.read(self.config_file) for section in self.parser.sections(): self.setdefault(section, {}) for option in self.parser.options(section): self[section].setdefault( option, self.parser.get(section, option) ) if self.gitconfig_file is None: self.gitconfig_file = os.path.join(os.environ['HOME'], '.gitconfig') self.gitconfig = load_gitconfig(self.gitconfig_file) self._load_creds_plugin()
def test_reading_config2(self): gc = load_gitconfig(filename=self.file_2) self.assertTrue('push' in gc.sections) self.assertTrue('pull' in gc.sections) self.assertTrue('alias' in gc.sections)