def set_basemap(self, basemap): """Set basemap from string `basemap`.""" try: self.basemap = poor.Map(basemap) poor.conf.basemap = basemap except Exception as error: print("Failed to load basemap '{}': {}" .format(basemap, str(error)), file=sys.stderr) if self.basemap is None: default = poor.conf.get_default("basemap") if default != basemap: self.set_basemap(default)
def set_basemap(self, basemap): """Set basemap from string `basemap`.""" try: newmap = (self.basemap is None or basemap != self.basemap.id) self.basemap = poor.Map(basemap) poor.conf.set_basemap(basemap) if newmap: pyotherside.send('basemap.changed') except Exception as error: print("Failed to load basemap '{}': {}" .format(basemap, str(error)), file=sys.stderr) if self.basemap is None: default = poor.conf.get_default("basemap") if default != basemap: self.set_basemap(default)