本文整理汇总了Python中kimchi.repositories.Repositories类的典型用法代码示例。如果您正苦于以下问题:Python Repositories类的具体用法?Python Repositories怎么用?Python Repositories使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Repositories类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: RepositoriesModel
class RepositoriesModel(object):
def __init__(self, **kargs):
try:
self.host_repositories = Repositories()
except:
self.host_repositories = None
def get_list(self):
if self.host_repositories is None:
raise InvalidOperation('KCHREPOS0014E')
return sorted(self.host_repositories.getRepositories())
def create(self, params):
if self.host_repositories is None:
raise InvalidOperation('KCHREPOS0014E')
return self.host_repositories.addRepository(params)
示例2: RepositoryModel
class RepositoryModel(object):
def __init__(self, **kargs):
try:
self._repositories = Repositories()
except:
self._repositories = None
def lookup(self, repo_id):
if self._repositories is None:
raise InvalidOperation('KCHREPOS0014E')
return self._repositories.getRepository(repo_id)
def enable(self, repo_id):
if self._repositories is None:
raise InvalidOperation('KCHREPOS0014E')
return self._repositories.enableRepository(repo_id)
def disable(self, repo_id):
if self._repositories is None:
raise InvalidOperation('KCHREPOS0014E')
return self._repositories.disableRepository(repo_id)
def update(self, repo_id, params):
if self._repositories is None:
raise InvalidOperation('KCHREPOS0014E')
return self._repositories.updateRepository(repo_id, params)
def delete(self, repo_id):
if self._repositories is None:
raise InvalidOperation('KCHREPOS0014E')
return self._repositories.removeRepository(repo_id)
示例3: RepositoryModel
class RepositoryModel(object):
def __init__(self, **kargs):
self._repositories = Repositories()
def lookup(self, repo_id):
return self._repositories.getRepository(repo_id)
def enable(self, repo_id):
if not self._repositories.enableRepository(repo_id):
raise OperationFailed("KCHREPOS0007E", {'repo_id': repo_id})
def disable(self, repo_id):
if not self._repositories.disableRepository(repo_id):
raise OperationFailed("KCHREPOS0008E", {'repo_id': repo_id})
def update(self, repo_id, params):
try:
self._repositories.updateRepository(repo_id, params)
except:
raise OperationFailed("KCHREPOS0009E", {'repo_id': repo_id})
return repo_id
def delete(self, repo_id):
return self._repositories.removeRepository(repo_id)
示例4: __init__
def __init__(self, **kargs):
try:
self._repositories = Repositories()
except:
self._repositories = None
示例5: __init__
def __init__(self, **kargs):
self._repositories = Repositories()