Skip to content

Commit

Permalink
fix end of line issues
Browse files Browse the repository at this point in the history
  • Loading branch information
marcolussetti committed Apr 22, 2022
1 parent 3fdd66c commit 34e0476
Show file tree
Hide file tree
Showing 2 changed files with 105 additions and 105 deletions.
154 changes: 77 additions & 77 deletions bin/githubcollaborators
Original file line number Diff line number Diff line change
@@ -1,77 +1,77 @@
#!/usr/bin/env python3

import argparse
import getpass
import json
import logging
import sys

from githubcollaborators import githubcollaborators


def main():
parser = argparse.ArgumentParser(
description="""List collaborators for all repositories for the given
user. Might take a while to run, be patient."""
)
parser.add_argument(
"-u",
"--username",
required=True,
help="GitHub username"
)
parser.add_argument(
"-t",
"--token",
required=False,
help="""Personal Access Token for the specified GitHub username.
Requires following permissions: repo("Full control of private
repositories"), admin: org -> read: org("Read or and team
membership, read org projects"), user -> read: user("Read all user
profile data")"""
)
parser.add_argument(
"-v",
"--visibility",
required=False,
help="Visibility level of the repositories, can be: all, public, or private"
)
parser.add_argument(
"-o",
"--output",
required=False,
help="Save to specified output file"
)
parser.add_argument(
"--verbose",
action="store_true",
help="Set logging level to INFO"
)

args = parser.parse_args()

# Logging config
logger = logging.getLogger("githubcollaborators")
if args.verbose:
logger.setLevel(logging.INFO)
else:
logger.setLevel(logging.ERROR)
handler = logging.StreamHandler(sys.stderr)
handler.setFormatter(logging.Formatter("[%(levelname)s]: %(message)s"))
logger.addHandler(handler)

token = getpass.getpass(
"GitHub Personal Access Token:") if args.token is None else args.token

repos_with_collaborators = githubcollaborators(
args.username, token, logger_obj=logger)

if args.output is not None:
with open(args.output, "w") as f:
json.dump(repos_with_collaborators, f, indent=2, sort_keys=True)
else:
print(json.dumps(repos_with_collaborators, indent=2, sort_keys=True))


if __name__ == "__main__":
main()
#!/usr/bin/env python3

import argparse
import getpass
import json
import logging
import sys

from githubcollaborators import githubcollaborators


def main():
parser = argparse.ArgumentParser(
description="""List collaborators for all repositories for the given
user. Might take a while to run, be patient."""
)
parser.add_argument(
"-u",
"--username",
required=True,
help="GitHub username"
)
parser.add_argument(
"-t",
"--token",
required=False,
help="""Personal Access Token for the specified GitHub username.
Requires following permissions: repo("Full control of private
repositories"), admin: org -> read: org("Read or and team
membership, read org projects"), user -> read: user("Read all user
profile data")"""
)
parser.add_argument(
"-v",
"--visibility",
required=False,
help="Visibility level of the repositories, can be: all, public, or private"
)
parser.add_argument(
"-o",
"--output",
required=False,
help="Save to specified output file"
)
parser.add_argument(
"--verbose",
action="store_true",
help="Set logging level to INFO"
)

args = parser.parse_args()

# Logging config
logger = logging.getLogger("githubcollaborators")
if args.verbose:
logger.setLevel(logging.INFO)
else:
logger.setLevel(logging.ERROR)
handler = logging.StreamHandler(sys.stderr)
handler.setFormatter(logging.Formatter("[%(levelname)s]: %(message)s"))
logger.addHandler(handler)

token = getpass.getpass(
"GitHub Personal Access Token:") if args.token is None else args.token

repos_with_collaborators = githubcollaborators(
args.username, token, logger_obj=logger)

if args.output is not None:
with open(args.output, "w") as f:
json.dump(repos_with_collaborators, f, indent=2, sort_keys=True)
else:
print(json.dumps(repos_with_collaborators, indent=2, sort_keys=True))


if __name__ == "__main__":
main()
56 changes: 28 additions & 28 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
import setuptools

with open("README.md", "r") as fh:
long_description = fh.read()

setuptools.setup(
name="githubcollaborators",
version="0.0.1",
author="Marco Lussetti",
author_email="packages@marcolussetti.com",
description="List collaborators for all of a user's repositories.",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/marcolussetti/githubcollaborators",
packages=setuptools.find_packages(),
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
python_requires='>=3.6',
scripts=[
'bin/githubcollaborators'
],
install_requires=[
'requests'
]
)
import setuptools

with open("README.md", "r") as fh:
long_description = fh.read()

setuptools.setup(
name="githubcollaborators",
version="0.0.2",
author="Marco Lussetti",
author_email="packages@marcolussetti.com",
description="List collaborators for all of a user's repositories.",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/marcolussetti/githubcollaborators",
packages=setuptools.find_packages(),
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
python_requires='>=3.6',
scripts=[
'bin/githubcollaborators'
],
install_requires=[
'requests'
]
)

0 comments on commit 34e0476

Please sign in to comment.