#NEWLINE# def createTeam( org , teamName , quiet = False ) : #NEWLINE# #INDENT# "\n    Only creates the team---doesn't add any members.\n    Returns the created team.\n    If team already exists, returns reference to that team object.\n    Returns False if team can't be created and can't be found.\n    " #NEWLINE# addPyGithubToPath ( ) #NEWLINE# from github import GithubException #NEWLINE# team = False #NEWLINE# try : #NEWLINE# #INDENT# team = org . create_team ( teamName , [ ] , 'push' ) #NEWLINE# if ( team != False ) : #NEWLINE# #INDENT# if ( not quiet ) : #NEWLINE# #INDENT# print ( ' team {0} created...' . format ( teamName ) , end = '' ) #NEWLINE# #UNINDENT# return team #NEWLINE# #UNINDENT# #UNINDENT# except GithubException as e : #NEWLINE# #INDENT# if ( ( 'errors' in e . data ) and ( e . data [ 'errors' ] [ 0 ] [ 'code' ] == 'already_exists' ) ) : #NEWLINE# #INDENT# if ( not quiet ) : #NEWLINE# #INDENT# print ( ' team {0} already exists...' . format ( teamName ) , end = '' ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# print ( e ) #NEWLINE# #UNINDENT# #UNINDENT# team = findTeam ( org , teamName ) #NEWLINE# if ( team != False ) : #NEWLINE# #INDENT# return team #NEWLINE# #UNINDENT# team = findTeam ( org , teamName , refresh = True ) #NEWLINE# if ( team != False ) : #NEWLINE# #INDENT# return team #NEWLINE# #UNINDENT# if ( not quiet ) : #NEWLINE# #INDENT# print ( 'ERROR: team {0} could not be created and was not found' . format ( teamName ) ) #NEWLINE# #UNINDENT# return False