Example #1
0
 def __init__(self,
              confdir=DEFAULT_CONFDIR,
              logger=None,
              dry_run=False,
              verbose=0):
     """ init method, run at class creation """
     # setup a logger; allow an existing one to be passed in to use
     self.logger = logger
     if logger is None:
         self.logger = logging.getLogger(self.__class__.__name__)
     if verbose > 1:
         self.logger.setLevel(logging.DEBUG)
     elif verbose > 0:
         self.logger.setLevel(logging.INFO)
     self.dry_run = dry_run
     self.confdir = os.path.abspath(os.path.expanduser(confdir))
     self.read_config(confdir)
     self.logger.debug("connecting to BattleNet API")
     self.bnet = battlenet.Connection()
     self.logger.debug("connected")
     self.logger.debug("loading character cache")
     self.character_cache = self.load_character_cache()
Example #2
0
 def setUp(self):
     self.connection = battlenet.Connection(public_key=PUBLIC_KEY, private_key=PRIVATE_KEY)
Example #3
0
 def setUp(self):
     self.connection = battlenet.Connection()
     self.connection_en = battlenet.Connection(locale='en')
Example #4
0
 def populate_realms(self):
     connection = battlenet.Connection()
     realmsData = connection.get_all_realms(battlenet.UNITED_STATES)
     for realm in realmsData:
         realms[realm.slug] = realm