提交 5b6d70dc 编写于 作者: S Shinwell Hu

fix lint

上级 5c5efc15
...@@ -44,10 +44,11 @@ class Gitee(object): ...@@ -44,10 +44,11 @@ class Gitee(object):
req = urllib.request.Request(url=url, data=data, headers=headers, method="POST") req = urllib.request.Request(url=url, data=data, headers=headers, method="POST")
try: try:
u = urllib.request.urlopen(req) u = urllib.request.urlopen(req)
return u.read().decode("utf-8")
except urllib.error.HTTPError as err: except urllib.error.HTTPError as err:
print("WARNING:" + str(err.code)) print("WARNING:" + str(err.code))
print("WARNING:" + str(err.headers)) print("WARNING:" + str(err.headers))
return u.read().decode("utf-8") return False
def fork_repo(self, repo): def fork_repo(self, repo):
""" """
...@@ -72,13 +73,12 @@ class Gitee(object): ...@@ -72,13 +73,12 @@ class Gitee(object):
values["title"] = "Upgrade to latest version of {repo}".format(repo=repo) values["title"] = "Upgrade to latest version of {repo}".format(repo=repo)
values["head"] = "{head}:master".format(head=head) values["head"] = "{head}:master".format(head=head)
values["base"] = "master" values["base"] = "master"
values["body"] = """ values["body"] = """This is a (mostly) automatically created PR by openEuler-Advisor.
This is a (mostly) automatically created PR by openEuler-Advisor. Please be noted that it's not throughly tested.
Please be noted that it's not throughly tested. Review carefully before accept this PR.
Review carefully before accept this PR. Thanks.
Thanks. Yours openEuler-Advisor.
Yours openEuler-Advisor. """
"""
return self.post_gitee(url, values) return self.post_gitee(url, values)
def get_gitee(self, url, headers=None): def get_gitee(self, url, headers=None):
......
...@@ -96,6 +96,7 @@ if __name__ == "__main__": ...@@ -96,6 +96,7 @@ if __name__ == "__main__":
pars.add_argument("-s", "--create_spec", help="Create spec file", action="store_true") pars.add_argument("-s", "--create_spec", help="Create spec file", action="store_true")
pars.add_argument("-d", "--download", help="Download upstream source code", action="store_true") pars.add_argument("-d", "--download", help="Download upstream source code", action="store_true")
pars.add_argument("-f", "--fork", help="fork src-openeuler repo into users", action="store_true") pars.add_argument("-f", "--fork", help="fork src-openeuler repo into users", action="store_true")
pars.add_argument("-c", "--clone", help="clone privatge repo to local", action="store_true")
pars.add_argument("-p", "--PR", help="Create upgrade PR", action="store_true") pars.add_argument("-p", "--PR", help="Create upgrade PR", action="store_true")
args = pars.parse_args() args = pars.parse_args()
...@@ -110,6 +111,8 @@ if __name__ == "__main__": ...@@ -110,6 +111,8 @@ if __name__ == "__main__":
if args.fork: if args.fork:
gt.fork_repo(args.pkg) gt.fork_repo(args.pkg)
if args.clone:
subprocess.call(["git", "clone", "git@gitee.com:shinwell_hu/"+args.pkg]) subprocess.call(["git", "clone", "git@gitee.com:shinwell_hu/"+args.pkg])
os.chdir(args.pkg) os.chdir(args.pkg)
......
---
version_control: git
src_repo: https://git.savannah.nongnu.org/git/acl.git
tag_prefix: "^v"
seperator: "."
last_query:
time_stamp: 2020-06-02 13:43:22.567974230 +00:00
raw_data: "545b91ea3954f6947f249d123654f24bec91c960\trefs/tags/v2.2.48\nfbda9a016a9e2d9391ae8a23d344b688ce7b1b8e\trefs/tags/v2.2.48^{}\n9071990b42461746e484e6a9d290af06a193defa\trefs/tags/v2.2.49\n05c5bdcb4dc865c5822d7da7d0043daf2076ed46\trefs/tags/v2.2.49^{}\n3fd085b41cba7826c2190964f8d5570a0cd1c7c8\trefs/tags/v2.2.50\nb1f432b59b658069187c2af913729c9b9be06f5a\trefs/tags/v2.2.50^{}\n3be4b7c5eb811829305242a7bc1e943a5949a1dc\trefs/tags/v2.2.51\n088bcbb414116ba7e0432e4cb90a8102ea14a959\trefs/tags/v2.2.51^{}\nf13e09bd54fd4a501c4952f002ed2752bdd9f93b\trefs/tags/v2.2.52\n80a5dd99233d69f18c6a6ec78aebc35652dd84f2\trefs/tags/v2.2.53\n65ff056ac4c25141cc06e484bce040635e4abd3d\trefs/tags/v2.2.53^{}\n"
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册