當前位置: 首頁>>代碼示例>>Python>>正文


Python repositories.Repositories類代碼示例

本文整理匯總了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)
開發者ID:EmperorBeezie,項目名稱:kimchi,代碼行數:18,代碼來源:host.py

示例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)
開發者ID:EmperorBeezie,項目名稱:kimchi,代碼行數:36,代碼來源:host.py

示例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)
開發者ID:Brainiarc7,項目名稱:kimchi,代碼行數:24,代碼來源:host.py

示例4: __init__

 def __init__(self, **kargs):
     try:
         self._repositories = Repositories()
     except:
         self._repositories = None
開發者ID:EmperorBeezie,項目名稱:kimchi,代碼行數:5,代碼來源:host.py

示例5: __init__

 def __init__(self, **kargs):
     self._repositories = Repositories()
開發者ID:Brainiarc7,項目名稱:kimchi,代碼行數:2,代碼來源:host.py


注:本文中的kimchi.repositories.Repositories類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。