我正试图编写一个小应用程序,从gerrit url的内容中提取robot注释:
rest = GerritRestAPI(url=options.gerrit_url, auth=HTTPDigestAuth(raw_input("username: "), raw_input("Password: ")), verify=True)
try:
changes = rest.get("gerrit/#/c/{change_id}/robotcomments")
logging.info("%d changes", len(changes))
for change in changes:
logging.info(change['change_id'])
except RequestException as err:
logging.error("Error: %s", str(err))
我按照restapi获取机器人评论数据, https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#list-change-robot-comments
由于某种原因,我得到一个404错误页面不存在。 有人知道如何使用pygerrit从url重新生成提交信息吗?在
我在调用rest.get("gerrit/#/c/{change_id}/robotcomments")
中尝试了很多添加url的方法,或者是{gerrit/#/c/{change_id}/robotcomments
它们都不起作用,我还发现调用rest.get
会将“a”添加到url中,因此我尝试使用下划线代码而不是pygerrit:
这也是失败的,请让我知道我做错了什么?在
看看Gerrit documentation,似乎应该使用:
而不是:
^{pr2}$相关问题 更多 >
编程相关推荐