本文整理汇总了Python中models.Issue.state方法的典型用法代码示例。如果您正苦于以下问题:Python Issue.state方法的具体用法?Python Issue.state怎么用?Python Issue.state使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Issue
的用法示例。
在下文中一共展示了Issue.state方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_digest
# 需要导入模块: from models import Issue [as 别名]
# 或者: from models.Issue import state [as 别名]
def get_digest(self):
"""
builds a DigestData instance filled with the digest
"""
issue_list = list(self.get_issues())
digest = DigestData()
digest.user = self._user
digest.repo = self._repository_name
for github_issue in issue_list:
if github_issue.state == IssueStates.OPEN:
digest.total_opened += 1
elif github_issue.state == IssueStates.CLOSED:
digest.total_closed += 1
digest.total_issues += 1
issue = Issue()
issue.url = github_issue.html_url
issue.label = '{}/{}#{}'.format(self._user, self._repository_name, github_issue.number)
issue.title = github_issue.title
issue.state = github_issue.state
github_user = github_issue.user
display_name = github_user.name or github_user.login
if display_name not in digest.users:
user = User()
user.name = display_name
user.gravatar = github_user.avatar_url
digest.users[display_name] = user
digest.issues.setdefault(display_name, []).append(issue)
return digest