connection.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:youtrack 作者: devopshq 项目源码 文件源码
def import_work_items(self, issue_id, work_items):
        xml = ''
        for work_item in work_items:
            xml += '<workItem>'
            xml += '<date>%s</date>' % work_item.date
            xml += '<duration>%s</duration>' % work_item.duration
            if hasattr(work_item, 'description') and work_item.description is not None:
                xml += '<description>%s</description>' % escape(work_item.description)
            if hasattr(work_item, 'worktype') and work_item.worktype is not None:
                xml += '<worktype><name>%s</name></worktype>' % work_item.worktype
            xml += '<author login=%s></author>' % quoteattr(work_item.authorLogin)
            xml += '</workItem>'
        if isinstance(xml, str):
            xml = xml.encode('utf-8')
        if xml:
            xml = '<workItems>' + xml + '</workItems>'
            self._req_xml('PUT',
                          '/import/issue/%s/workitems' % urlquote(issue_id), xml)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号