def run(self): options = self.options # Load in our file try: map = Map(options['filename']) map.read() self.map = map except LoadException, e: print '"' + options['filename'] + '" could not be opened' print e return False
def load_maps(self): """ Read our collection of maps from the dir """ self.maps = [] self.maps_loaded = True map_filenames = sorted(glob.glob(os.path.join(self.directory, '*.map'))) for map_filename in map_filenames: try: (book, mapname, df) = Map.get_mapinfo(map_filename) self.maps.append(SaveslotMap(map_filename, mapname, book)) except: # Don't bother reporting, don't think it's worth it for our # typical use cases pass