def get_repo(self, repo_id): """Get the repo which has the id `repo_id`. Raises :exc:`DoesNotExist` if no such repo exists. """ repo_json = self.client.get('/api2/repos/' + repo_id).json() return Repo.from_json(self.client, repo_json)
def list_repos(self): """List the repos. Return a list of objects of class :class:`Repo`. """ repos_json = self.client.get(self.REPOS_URL).json() return [Repo.from_json(self.client, j) for j in repos_json]
def list_repos(self, type=None): params = {} if type is not None: params['type'] = type repos_json = self.client.get('/api2/repos/', params=params).json() return [Repo.from_json(self.client, j) for j in repos_json]
def list_repos(self): repos_json = self.client.get('/api2/repos/').json() return [Repo.from_json(self.client, j) for j in repos_json]
def list_repos(self, type=None): query = '' if type: query = '?' + urlencode(dict(type=type)) repos_json = self.client.get('/api2/repos/' + query).json() return [Repo.from_json(self.client, j) for j in repos_json]