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


Python Issue.by_tracker_id方法代码示例

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


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

示例1: sync

# 需要导入模块: from issues.models import Issue [as 别名]
# 或者: from issues.models.Issue import by_tracker_id [as 别名]
 def sync(self, tracker):
     server = ServerProxy(tracker.config, allow_none=True,
                          use_datetime=datetime)
     last_update = DateTime(time.mktime(tracker.last_update.timetuple()))
     users = self._get_users(server)
     ids = map(int, server.filter('issue', None, {'activity':
                                                  str(last_update)}))
     for issue_id in ids:
         data = server.display('issue%d' % issue_id, 'title', 'creation',
                               'creator', 'assignedto', 'activity',
                               'messages', 'status')
         issue = Issue.by_tracker_id(tracker.id, issue_id)
         issue.no = issue_id
         issue.set_title(data.get('title', ''))
         issue.set_description(self._get_description(
             server, data.get('messages', [])))
         issue.reporter = users[int(data['creator'])]
         issue.owner = users[int(data['assignedto'])]
         issue.last_change = _roundup_date_to_datetime(data.get('activity'))
         status = int(data.get('status', -1))
         issue.active = status in ACTIVE_STATUS
         issue.tracker = tracker
         if not issue.id:
             issue.created = datetime.now()
         issue.updated = datetime.now()
         issue.save()
         post_issue_sync.send(sender=self, issue=issue)
         self._update_user_data(server, data, issue, users)
     tracker.last_update = datetime.now() - timedelta(days=1)
     tracker.save()
     post_tracker_sync.send(sender=self, tracker=tracker)
     return True
开发者ID:hkage,项目名称:django-issue-synchronisation,代码行数:34,代码来源:roundup.py

示例2: str

# 需要导入模块: from issues.models import Issue [as 别名]
# 或者: from issues.models.Issue import by_tracker_id [as 别名]
         err.errcode, err.errmsg))
     return False
 except Error, err:
     self._log.error('Error: %s' % err)
     return False
 except:
     self._log.error('Unknown error: %s' % str(sys.exc_info()[1]))
     return False
 self._log.info('Trac XMLRPC-API version: %s' % '.'.join(map(
     str, api_version)))
 d = DateTime(time.mktime(tracker.last_update.timetuple()))
 self._log.info('Last update: %s' % d)
 tids = server.ticket.getRecentChanges(d)
 self._log.info('Issue updates: %s' % `tids`)
 for tid in tids:
     issue = Issue.by_tracker_id(tracker.id, tid)
     id_, cr_date, last_change, data = server.ticket.get(tid)
     #if isinstance(cr_date, int):
         #cr_date = datetime.fromtimestamp(cr_date)
         #last_change = datetime.fromtimestamp(last_change)
     issue.no = id_
     issue.set_title(data.get('summary', ''))
     issue.set_description(data.get('description', ''))
     issue.reporter = data.get('reporter')
     issue.owner = data.get('owner')
     issue.last_change = last_change
     issue.tracker = tracker
     # Only default status values are allowed as Trac allows renaming
     # of status values.
     resolution = data.get('resolution')
     issue.active = resolution in ACTIVE_STATUS
开发者ID:pombredanne,项目名称:django-issue-synchronisation,代码行数:33,代码来源:trac.py


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