예제 #1
0
 def get_character(self, name, realm, site, cached=False, force_refresh=False):
     """Return a character object. This only stubs the guild, which means
     the guild won't be populated with characters."""
     log.debug("Getting character " + name + "...")
     
     character = self._session.query(Character).get((name, realm, site))
     
     # cflewis | 2009-04-11 | Check if a character is actually updated
     # on the armory. If not, return the database version anyway.
     if character and (cached == True or character.is_updated_on_armory() == False) and not force_refresh:
         return character            
     
     source = self._download_url(\
         WoWSpyderLib.get_character_sheet_url(name, realm, site))
     character = self._parse_character(StringIO.StringIO(source), site)
         
     return character
예제 #2
0
 def url(self):
     return WoWSpyderLib.get_character_sheet_url(self.name, self.realm, self.site)