Skip to content

Commit 5c090b4

Browse files
Fixed flake8 errors
1 parent d90f9a9 commit 5c090b4

File tree

1 file changed

+20
-17
lines changed

1 file changed

+20
-17
lines changed

scripts/push_repo.py

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,44 @@
22

33
import argparse
44
import os
5-
import sys
6-
from github_secrets import GITHUB_API_TOKEN, USERNAME
5+
from github_secrets import GITHUB_API_TOKEN
6+
77

88
def parseArgs():
99
parser = argparse.ArgumentParser(description='Push an existing local repository to a newly created remote repository of the same name') # noqa: E501
1010
parser.add_argument('path',
11-
metavar='PATH',
12-
type=str,
13-
help='Enter the path for existing local repository')
11+
metavar='PATH',
12+
type=str,
13+
help='Enter the path for existing local repository')
1414
parser.add_argument('url',
15-
metavar='URL',
16-
type=str,
17-
help='Enter the newly created remote repository url (.git)')
15+
metavar='URL',
16+
type=str,
17+
help='Enter the newly created remote repository url (.git)')
1818
parser.add_argument('description',
19-
metavar='DESCRIPTION',
20-
type=str,
21-
help='Enter the description for remote repository')
19+
metavar='DESCRIPTION',
20+
type=str,
21+
help='Enter the description for remote repository')
2222
args = parser.parse_args()
23-
return args
23+
return args
24+
2425

2526
def pushRepo(remote_url):
26-
origin = remote_url[:8] + GITHUB_API_TOKEN +"@"+ remote_url[8:]
27+
origin = remote_url[:8] + GITHUB_API_TOKEN + "@" + remote_url[8:]
2728
os.system(f'git push {origin} --mirror')
28-
29+
30+
2931
def main():
3032
path = args.path
3133
remote_url = args.url
3234

3335
os.chdir(path)
34-
if(os.path.isdir('./.git') == False):
36+
if os.path.isdir('./.git') is False:
3537
print("Not in a git directory")
3638
exit()
37-
39+
3840
pushRepo(remote_url)
3941

42+
4043
if __name__ == "__main__":
4144
args = parseArgs()
42-
main()
45+
main()

0 commit comments

Comments
 (0)