本文整理匯總了Python中models.Issue.label方法的典型用法代碼示例。如果您正苦於以下問題:Python Issue.label方法的具體用法?Python Issue.label怎麽用?Python Issue.label使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類models.Issue
的用法示例。
在下文中一共展示了Issue.label方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: get_digest
# 需要導入模塊: from models import Issue [as 別名]
# 或者: from models.Issue import label [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