Skip to content

Commit 34e0476

Browse files
committed
fix end of line issues
1 parent 3fdd66c commit 34e0476

File tree

2 files changed

+105
-105
lines changed

2 files changed

+105
-105
lines changed

bin/githubcollaborators

Lines changed: 77 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,77 @@
1-
#!/usr/bin/env python3
2-
3-
import argparse
4-
import getpass
5-
import json
6-
import logging
7-
import sys
8-
9-
from githubcollaborators import githubcollaborators
10-
11-
12-
def main():
13-
parser = argparse.ArgumentParser(
14-
description="""List collaborators for all repositories for the given
15-
user. Might take a while to run, be patient."""
16-
)
17-
parser.add_argument(
18-
"-u",
19-
"--username",
20-
required=True,
21-
help="GitHub username"
22-
)
23-
parser.add_argument(
24-
"-t",
25-
"--token",
26-
required=False,
27-
help="""Personal Access Token for the specified GitHub username.
28-
Requires following permissions: repo("Full control of private
29-
repositories"), admin: org -> read: org("Read or and team
30-
membership, read org projects"), user -> read: user("Read all user
31-
profile data")"""
32-
)
33-
parser.add_argument(
34-
"-v",
35-
"--visibility",
36-
required=False,
37-
help="Visibility level of the repositories, can be: all, public, or private"
38-
)
39-
parser.add_argument(
40-
"-o",
41-
"--output",
42-
required=False,
43-
help="Save to specified output file"
44-
)
45-
parser.add_argument(
46-
"--verbose",
47-
action="store_true",
48-
help="Set logging level to INFO"
49-
)
50-
51-
args = parser.parse_args()
52-
53-
# Logging config
54-
logger = logging.getLogger("githubcollaborators")
55-
if args.verbose:
56-
logger.setLevel(logging.INFO)
57-
else:
58-
logger.setLevel(logging.ERROR)
59-
handler = logging.StreamHandler(sys.stderr)
60-
handler.setFormatter(logging.Formatter("[%(levelname)s]: %(message)s"))
61-
logger.addHandler(handler)
62-
63-
token = getpass.getpass(
64-
"GitHub Personal Access Token:") if args.token is None else args.token
65-
66-
repos_with_collaborators = githubcollaborators(
67-
args.username, token, logger_obj=logger)
68-
69-
if args.output is not None:
70-
with open(args.output, "w") as f:
71-
json.dump(repos_with_collaborators, f, indent=2, sort_keys=True)
72-
else:
73-
print(json.dumps(repos_with_collaborators, indent=2, sort_keys=True))
74-
75-
76-
if __name__ == "__main__":
77-
main()
1+
#!/usr/bin/env python3
2+
3+
import argparse
4+
import getpass
5+
import json
6+
import logging
7+
import sys
8+
9+
from githubcollaborators import githubcollaborators
10+
11+
12+
def main():
13+
parser = argparse.ArgumentParser(
14+
description="""List collaborators for all repositories for the given
15+
user. Might take a while to run, be patient."""
16+
)
17+
parser.add_argument(
18+
"-u",
19+
"--username",
20+
required=True,
21+
help="GitHub username"
22+
)
23+
parser.add_argument(
24+
"-t",
25+
"--token",
26+
required=False,
27+
help="""Personal Access Token for the specified GitHub username.
28+
Requires following permissions: repo("Full control of private
29+
repositories"), admin: org -> read: org("Read or and team
30+
membership, read org projects"), user -> read: user("Read all user
31+
profile data")"""
32+
)
33+
parser.add_argument(
34+
"-v",
35+
"--visibility",
36+
required=False,
37+
help="Visibility level of the repositories, can be: all, public, or private"
38+
)
39+
parser.add_argument(
40+
"-o",
41+
"--output",
42+
required=False,
43+
help="Save to specified output file"
44+
)
45+
parser.add_argument(
46+
"--verbose",
47+
action="store_true",
48+
help="Set logging level to INFO"
49+
)
50+
51+
args = parser.parse_args()
52+
53+
# Logging config
54+
logger = logging.getLogger("githubcollaborators")
55+
if args.verbose:
56+
logger.setLevel(logging.INFO)
57+
else:
58+
logger.setLevel(logging.ERROR)
59+
handler = logging.StreamHandler(sys.stderr)
60+
handler.setFormatter(logging.Formatter("[%(levelname)s]: %(message)s"))
61+
logger.addHandler(handler)
62+
63+
token = getpass.getpass(
64+
"GitHub Personal Access Token:") if args.token is None else args.token
65+
66+
repos_with_collaborators = githubcollaborators(
67+
args.username, token, logger_obj=logger)
68+
69+
if args.output is not None:
70+
with open(args.output, "w") as f:
71+
json.dump(repos_with_collaborators, f, indent=2, sort_keys=True)
72+
else:
73+
print(json.dumps(repos_with_collaborators, indent=2, sort_keys=True))
74+
75+
76+
if __name__ == "__main__":
77+
main()

setup.py

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
import setuptools
2-
3-
with open("README.md", "r") as fh:
4-
long_description = fh.read()
5-
6-
setuptools.setup(
7-
name="githubcollaborators",
8-
version="0.0.1",
9-
author="Marco Lussetti",
10-
author_email="[email protected]",
11-
description="List collaborators for all of a user's repositories.",
12-
long_description=long_description,
13-
long_description_content_type="text/markdown",
14-
url="https://github.com/marcolussetti/githubcollaborators",
15-
packages=setuptools.find_packages(),
16-
classifiers=[
17-
"Programming Language :: Python :: 3",
18-
"License :: OSI Approved :: MIT License",
19-
"Operating System :: OS Independent",
20-
],
21-
python_requires='>=3.6',
22-
scripts=[
23-
'bin/githubcollaborators'
24-
],
25-
install_requires=[
26-
'requests'
27-
]
28-
)
1+
import setuptools
2+
3+
with open("README.md", "r") as fh:
4+
long_description = fh.read()
5+
6+
setuptools.setup(
7+
name="githubcollaborators",
8+
version="0.0.2",
9+
author="Marco Lussetti",
10+
author_email="[email protected]",
11+
description="List collaborators for all of a user's repositories.",
12+
long_description=long_description,
13+
long_description_content_type="text/markdown",
14+
url="https://github.com/marcolussetti/githubcollaborators",
15+
packages=setuptools.find_packages(),
16+
classifiers=[
17+
"Programming Language :: Python :: 3",
18+
"License :: OSI Approved :: MIT License",
19+
"Operating System :: OS Independent",
20+
],
21+
python_requires='>=3.6',
22+
scripts=[
23+
'bin/githubcollaborators'
24+
],
25+
install_requires=[
26+
'requests'
27+
]
28+
)

0 commit comments

Comments
 (0)