Ejemplo n.º 1
0
    def add_repository (self, path, alias, **properties) :
        if self.has_repository(alias, ) :
            raise KeyError("'%s' already exists." % alias, )

        self._config.add_section(self._r(alias), )

        if not utils.is_remote_repository_path(path, ) :
            path = utils.normpath(path, )

        properties["path"] = path
        if "description" in properties :
            properties["description"] = " ".join(
                    properties.get("description"), )

        for i, j in self.to_config_properties(
                self.default_repository, **properties) :
            self._config.set(self._r(alias), i, j, )

        return self
Ejemplo n.º 2
0
 def is_remote_repository (self, alias, ) :
     return utils.is_remote_repository_path(
             self.get_repository_property(alias, "path", ), )