@@ -470,19 +470,9 @@ def __init__(self, map_file, filename=None, gateway=None, map_hash=None, **optio
470470 self .archive = MPQArchive (map_file )
471471 self .minimap = self .archive .read_file ('Minimap.tga' )
472472
473- @classmethod
474- def get_url (cls , gateway , map_hash ):
475- if gateway and map_hash :
476- return cls .url_template .format (gateway , map_hash )
477- else :
478- return None
479-
480- def load (self ):
481- self .read_game_strings ()
482-
483- def read_game_strings (self ):
484- self .game_strings = self .archive .read_file ('enUS.SC2Data\LocalizedData\GameStrings.txt' )
485- for line in self .game_strings .split ('\r \n ' ):
473+ # TODO: We probably shouldn't favor enUS here?
474+ game_strings = self .archive .read_file ('enUS.SC2Data\LocalizedData\GameStrings.txt' )
475+ for line in game_strings .split ('\r \n ' ):
486476 parts = line .split ('=' )
487477 if parts [0 ] == 'DocInfo/Name' :
488478 self .name = parts [1 ]
@@ -491,6 +481,14 @@ def read_game_strings(self):
491481 elif parts [0 ] == 'DocInfo/DescLong' :
492482 self .description = parts [1 ]
493483
484+ @classmethod
485+ def get_url (cls , gateway , map_hash ):
486+ """Builds a download URL for the map from its components."""
487+ if gateway and map_hash :
488+ return cls .url_template .format (gateway , map_hash )
489+ else :
490+ return None
491+
494492
495493class GameSummary (Resource ):
496494 base_url_template = 'http://{0}.depot.battle.net:1119/{1}.{2}'
0 commit comments