Skip to content

Commit

Permalink
Merge pull request #2 from hanpeter/private-orgs
Browse files Browse the repository at this point in the history
Private orgs
  • Loading branch information
hanpeter authored Oct 5, 2016
2 parents 39c4e6f + 5815a5d commit 5723ae9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion github_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

class Application(object):
DEFAULT_FIELD_NAMES = ['name', 'login']
VERSION = '0.0.2'

def __init__(self, github_token):
"""
Expand Down Expand Up @@ -48,7 +49,7 @@ def _get_users(self, org_name, field_names=DEFAULT_FIELD_NAMES):
# Find the organization with the given name
# GOTCHA: Assumes the given name is exact and looks for a perfect match
# GOTCHA: Assumes there is only 1 organization with the given name
org = [org for org in self._github.iter_orgs(login=self._me.login) if org.login == org_name][0]
org = [org for org in self._github.iter_orgs() if org.login == org_name][0]

for user in org.iter_members():
# For every user, grab the whole user object and yield
Expand Down Expand Up @@ -186,6 +187,9 @@ def pprint(self, org_name, output=None, field_names=DEFAULT_FIELD_NAMES, *args,
'(default: ' + str(Application.DEFAULT_FIELD_NAMES) + ')'
)
)
@click.version_option(
version=Application.VERSION,
)
def main(org_name, github_token, output_format, output, field_names):
"""
Prints out a list of users in the given GitHub organization.
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

from __future__ import absolute_import
from setuptools import setup
from github_users import Application


# We use the version to construct the DOWNLOAD_URL.
VERSION = '0.0.1'
VERSION = Application.VERSION

# URL to the repository on Github.
REPO_URL = 'https://github.com/hanpeter/github-users'
Expand Down

0 comments on commit 5723ae9

Please sign in to comment.