当前位置: 首页>>代码示例>>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;未经允许,请勿转载。