本文整理匯總了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()