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


Python SoapClient.mc_enum_priorities方法代码示例

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


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

示例1: MantisBT

# 需要导入模块: from pysimplesoap.client import SoapClient [as 别名]
# 或者: from pysimplesoap.client.SoapClient import mc_enum_priorities [as 别名]
class MantisBT(object):

    def __init__(self, username, password, url):
        if not url.endswith("?wsdl"):
            if url.endswith("/api/soap/mantisconnect.php"):
                url += "?wdsl"
            elif url.endswith("/"):
                url += "api/soap/mantisconnect.php?wsdl"
            else:
                url += "/api/soap/mantisconnect.php?wsdl"

        self.client = SoapClient(wsdl=url, trace=False)
        self.username = username
        self.password = password
        self._status = None
        self._priorities = None
        self._severities = None
        self._resolutions = None
        self._projects = None

    def comment(self, ticket, content):
        if type(content) is str:
            content = content.decode("utf-8")
        self.client.mc_issue_note_add(
            username=self.username,
            password=self.password,
            issue_id=int(ticket),
            note={
                "text": content
            }
        )

    def issue(self, issue_id):
        return self.client.mc_issue_get(
            username=self.username,
            password=self.password,
            issue_id=int(issue_id)
        )['return']

    @property
    def status(self):
        if not self._status:
            self._status = map(
                lambda n: n.get("item"),
                self.client.mc_enum_status(
                    username=self.username,
                    password=self.password
                )['return']
            )
        return self._status

    @property
    def priorities(self):
        if not self._priorities:
            self._priorities = map(
                lambda n: n.get("item"),
                self.client.mc_enum_priorities(
                    username=self.username,
                    password=self.password
                )['return']
            )
        return self._priorities

    @property
    def severities(self):
        if not self._severities:
            self._severities = map(
                lambda n: n.get("item"),
                self.client.mc_enum_severities(
                    username=self.username,
                    password=self.password
                )['return']
            )
        return self._severities

    @property
    def resolutions(self):
        if not self._resolutions:
            self._resolutions = map(
                lambda n: n.get("item"),
                self.client.mc_enum_resolutions(
                    username=self.username,
                    password=self.password
                )['return']
            )
        return self._resolutions

    @property
    def projects(self):
        if not self._projects:

            def _proj(proj):
                return {
                    "id": int(proj["item"].id),
                    "name": unicode(proj["item"].name)
                }
            projs = self.client.mc_projects_get_user_accessible(
                username=self.username,
                password=self.password
            )['return']
#.........这里部分代码省略.........
开发者ID:xiaocong,项目名称:mantisbt,代码行数:103,代码来源:mantis.py


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