def setup_github():
 try:
  if (sickbeard.GIT_USERNAME and sickbeard.GIT_PASSWORD):
   sickbeard.gh = Github(login_or_token=sickbeard.GIT_USERNAME, password=sickbeard.GIT_PASSWORD, user_agent=u'SickRage')
 except Exception as error:
  sickbeard.gh = None
  sickbeard.logger.log(u'Unable to setup GitHub properly with your github login. Please check your credentials. Error: {0}'.format(error), sickbeard.logger.WARNING)
 if (not sickbeard.gh):
  try:
   sickbeard.gh = Github(user_agent=u'SickRage')
  except Exception as error:
   sickbeard.gh = None
   sickbeard.logger.log(u'Unable to setup GitHub properly. GitHub will not be available. Error: {0}'.format(error), sickbeard.logger.WARNING)

def setup_github ( ) : try : if ( sickbeard . GIT_USERNAME and sickbeard . GIT_PASSWORD ) : sickbeard . gh = Github ( login_or_token = sickbeard . GIT_USERNAME , password = sickbeard . GIT_PASSWORD , user_agent = u'SickRage' ) except Exception as error : sickbeard . gh = None sickbeard . logger . log ( u'Unable to setup GitHub properly with your github login. Please check your credentials. Error: {0}' . format ( error ) , sickbeard . logger . WARNING ) if ( not sickbeard . gh ) : try : sickbeard . gh = Github ( user_agent = u'SickRage' ) except Exception as error : sickbeard . gh = None sickbeard . logger . log ( u'Unable to setup GitHub properly. GitHub will not be available. Error: {0}' . format ( error ) , sickbeard . logger . WARNING )
instantiate the global github connection .