def get_arena_teams(self, battlegroup, realm, site, get_characters=False, \ ladders=[2,3,5], max_pages=None): '''Returns a list of arena teams as team objects. Setting get_characters to true will cause teams, their characters and their guilds to be downloaded. This cascading effect is very slow and should be used with caution. ''' all_teams = [] for ladder_number in ladders: try: source = self._download_url( \ WoWSpyderLib.get_arena_url(battlegroup, realm, site, \ ladder_number=ladder_number)) except Exception, e: log.warning("Couldn't get arena page for ladder " + str(ladder_number) + ", continuing. ERROR: " + str(e)) continue if not max_pages: try: max_pages = WoWSpyderLib.get_max_pages(source) except AttributeError, e: # cflewis | 2009-04-22 | This means that # this arena will be skipped, but it's better than # crashing max_pages = 0
def testGetEUArenaURLNonUnicode(self): eu_url = WoWSpyderLib.get_arena_url(self.eu_battlegroup, self.eu_realm, "eu") self.assertTrue(re.match("http://eu.wowarmory", eu_url))
def testGetUSArenaURL(self): us_url = WoWSpyderLib.get_arena_url(self.us_battlegroup, \ self.us_realm, u"us") self.assertTrue(re.match("http://www.wowarmory", us_url))