Ejemplo n.º 1
0
 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)
Ejemplo n.º 2
0
 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()
Ejemplo n.º 3
0
 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)
Ejemplo n.º 4
0
    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()
Ejemplo n.º 5
0
    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()
Ejemplo n.º 6
0
 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()
Ejemplo n.º 7
0
 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)