代码拉取完成,页面将自动刷新
同步操作将从 ydna0/oepkgsbuild_check 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
from tools import get_requests
class GiteeMessage(object):
"""
the result in table to comment
"""
def __init__(self,pr_num,repo_name,gitee_token):
"""
:param pr_num: the pr number
:param repo_name: the name of the repo
:param gitee_token: the toen of the gitee user
"""
self._pr_num=pr_num
self._repo_name=repo_name
self._gitee_token=gitee_token
def comment_pr(self,comment):
"""
comment pull request
:param comment: the content of the comment
:return:
whether successfully comment the pr
"""
#logger.debug("comment pull request %s", pr_num)
owner="src-oepkgs"
comment_pr_url = "https://gitee.com/api/v5/repos/{}/{}/pulls/{}/comments".format(owner, self._repo_name, self._pr_num)
data = {"access_token": self._gitee_token, "body": comment}
rs = get_requests("post", comment_pr_url, body=data, timeout=30)
if rs != 0:
#logger.warning("pr comment failed")
return False
return True
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。