66import json
77import uuid
88import logging
9- from typing import Tuple , List
9+ from typing import Tuple , List , Generator
1010from functools import lru_cache
1111
1212import requests
@@ -33,7 +33,7 @@ def __init__(self, github_organization_name: str, token: str):
3333 self .organization = github_organization_name
3434 self .token = token
3535
36- def _get_owner_id (self , name ) :
36+ def _get_owner_id (self , name : str ) -> str :
3737 """Performs a lookup for the related internal github ID needed as a key for other queries"""
3838 query = """
3939 {
@@ -131,7 +131,7 @@ def create_organizational_project(self, name: str, description: str, columns: li
131131
132132 return project_url , responses
133133
134- def add_columns (self , project_id , columns ) :
134+ def add_columns (self , project_id : str , columns : List [ dict ]) -> List :
135135 """
136136 Add column(s) to the given project.
137137
@@ -173,7 +173,7 @@ class GithubOrganizationManager(GithubPagedRequestHandler):
173173 Functions/Tools for managing Github Organization Projects
174174 """
175175
176- def __init__ (self , oauth_token = GITHUB_ACCESS_TOKEN , org = None ):
176+ def __init__ (self , oauth_token : str = GITHUB_ACCESS_TOKEN , org : str = None ):
177177 """
178178 :param oauth_token: GITHUB OAUTH TOKEN
179179 :param org: GITHUB ORGANIZATION NAME
@@ -220,7 +220,7 @@ def create_organizational_project(self, *args, **kwargs) -> Tuple[str, List[obje
220220 return graphql_manager .create_organizational_project (* args , ** kwargs )
221221
222222 @lru_cache (maxsize = 10 )
223- def projects (self ):
223+ def projects (self ) -> Generator [ GithubOrganizationProject , None , None ] :
224224 """
225225 :return: list of organization project objects
226226 """
@@ -232,15 +232,15 @@ def projects(self):
232232 yield from (GithubOrganizationProject (self ._session , p ) for p in projects_data )
233233
234234 @lru_cache (maxsize = 10 )
235- def repositories (self , names = None ):
236- def classify (repository_dict ) :
235+ def repositories (self , names : List [ str ] = None ) -> Generator [ GithubRepository , None , None ] :
236+ def classify (repository_response : dict ) -> GithubRepository :
237237 """
238- Load Github repository API dictionary representation to an internally defined GitRepository Object
239- :param repository_dict : (dict) github Repository dictionary Representation
238+ Load Github repository API dictionary representation into an internally defined GitRepository Object
239+ :param repository_response : (dict) github Repository dictionary Representation
240240 :return: (obj) GithubRepository
241241 """
242- repoository_json = json .dumps (repository_dict )
243- repository = json .loads (repoository_json , object_hook = GithubRepository .from_dict )
242+ repository_json = json .dumps (repository_response )
243+ repository = json .loads (repository_json , object_hook = GithubRepository .from_dict )
244244 repository ._session = self ._session # attach session so queries can be made
245245 repository ._org = self .org
246246 return repository
@@ -298,6 +298,3 @@ def classify(repository_dict):
298298 print ('---' )
299299 for urls in project .repository_urls ():
300300 print (urls )
301-
302-
303-
0 commit comments