@@ -173,18 +173,19 @@ class GithubOrganizationManager(GithubPagedRequestHandler):
173173 Functions/Tools for managing Github Organization Projects
174174 """
175175
176- def __init__ (self , oauth_token : str = GITHUB_ACCESS_TOKEN , org : str = None ):
176+ def __init__ (self , organization : str , token : str = GITHUB_ACCESS_TOKEN ):
177177 """
178- :param oauth_token: GITHUB OAUTH TOKEN
179- :param org: GITHUB ORGANIZATION NAME
180- :param projects: (list) project names to filter
178+ :param organization: Github organization name
179+ :param token: Github personal access token
180+ (see: https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/)
181+
181182 """
182- self ._oauth_token = oauth_token
183- if not self ._oauth_token :
183+ self ._token = token
184+ if not self ._token :
184185 raise GithubAccessTokenNotDefined ('Set the GITHUB_ACCESS_TOKEN envar, or pass on GithubOrganizationManager instantiation!' )
185186
186187 self ._session = requests .session ()
187- self ._session .headers .update ({'Authorization' : 'token {}' .format (oauth_token )})
188+ self ._session .headers .update ({'Authorization' : 'token {}' .format (token )})
188189 # Accept Header added for GITHUB projects API support
189190 # See:
190191 # https://developer.github.com/v3/projects/
@@ -194,7 +195,7 @@ def __init__(self, oauth_token: str=GITHUB_ACCESS_TOKEN, org: str=None):
194195 adapter = requests .adapters .HTTPAdapter (pool_connections = 100 , pool_maxsize = 100 )
195196 self ._session .mount ('https://' , adapter )
196197
197- self .org = org
198+ self .org = organization
198199
199200 def create_organizational_project (self , * args , ** kwargs ) -> Tuple [str , List [object ]]:
200201 """
@@ -215,7 +216,7 @@ def create_organizational_project(self, *args, **kwargs) -> Tuple[str, List[obje
215216 """
216217 graphql_manager = GithubGraphQLManager (
217218 github_organization_name = self .org ,
218- token = self ._oauth_token ,
219+ token = self ._token ,
219220 )
220221 return graphql_manager .create_organizational_project (* args , ** kwargs )
221222
@@ -289,8 +290,8 @@ def classify(repository_response: dict) -> GithubRepository:
289290 if args .verbose :
290291 logger .setLevel (logging .DEBUG )
291292
292- manager = GithubOrganizationManager (args .token ,
293- args .organization )
293+ manager = GithubOrganizationManager (args .organization ,
294+ args .token )
294295 for project in manager .projects ():
295296 if project .name in args .projects :
296297 for issue in project .issues ():
0 commit comments