当前位置: 首页>>代码示例>>Python>>正文


Python SOAPProxy.getReleases方法代码示例

本文整理汇总了Python中SOAPpy.SOAPProxy.getReleases方法的典型用法代码示例。如果您正苦于以下问题:Python SOAPProxy.getReleases方法的具体用法?Python SOAPProxy.getReleases怎么用?Python SOAPProxy.getReleases使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SOAPpy.SOAPProxy的用法示例。


在下文中一共展示了SOAPProxy.getReleases方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: GForgeProxy

# 需要导入模块: from SOAPpy import SOAPProxy [as 别名]
# 或者: from SOAPpy.SOAPProxy import getReleases [as 别名]

#.........这里部分代码省略.........

        (project_id,) = self.convert_to_id(project_id)
        pkgs = self.server.getPackages(self.session, project_id)
        return [pkg['name'] for pkg in pkgs]

    def get_package_id(self, project_id, pkg_name):
        """ 
        Return the package id, -1 if failed 
        @param project_id : a number or a name
        """
        (project_id,) = self.convert_to_id(project_id)
        pkg_name = pkg_name.lower()

        try:
            pkgs = self.server.getPackages(self.session, project_id)

            for pkg in pkgs:
                if (pkg['name'].lower() == pkg_name):
                    return pkg['package_id']

        except:
            pass

        return -1

    def get_releases(self, project_id, package_id):
        """ 
        Return a list of release name 
        @param project_id : a number or a name
        @param package_id : a number or a name
        """
        project_id, package_id = self.convert_to_id(project_id, package_id)

        rels = self.server.getReleases(self.session, project_id, package_id)
        return [rel['name'] for rel in rels]

    def get_release_id(self, project_id, package_id, release_name):
        """ 
        Return the release id, -1 if failed 
        @param project_id : a number or a name
        @param package_id : a number or a name
        """
        release_name = release_name.lower()
        project_id, package_id = self.convert_to_id(project_id, package_id)

        try:
            releases = self.server.getReleases(self.session, project_id,
                                               package_id)

            for rel in releases:
                if (rel['name'].lower() == release_name):
                    return rel['release_id']
        except:
            pass

        return -1

    def get_release_details(self, project_id, package_id, release_id):
        """ 
        Return a tuple (name, date, notes, changes) 
        @param project_id : a number or a name
        @param package_id : a number or a name
        @param release_id : a number or a name
        """

        project_id, package_id, release_id = \
开发者ID:openalea,项目名称:deploy,代码行数:70,代码来源:gforge.py


注:本文中的SOAPpy.SOAPProxy.getReleases方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。