Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def loadPlaces(self, name):
self.logger.info("load places")
available_explo = qi.path.findData(self.application_name, name + self.places_extension, False)
if len(available_explo) > 0:
#load an existing annotated explo
in_file = open(available_explo, "rb")
data = pickle.load(in_file)
in_file.close()
if not("name" in data) or not("places" in data):
self.logger.error("wrong annoted explo format")
return False
self.current_places = data
explo_path = qi.path.findData(self.explorer_application_name, name + self.explo_extension, False)
if len(explo_path) > 0:
try:
self.nav.loadExploration(explo_path)
except Exception as e:
self.logger.warning("Unable to load places: " + str(e))
return False