def makeDoor(self, door): try: d = Door("model/" + door["model"] + ".json", door["openWith"], door["permanent"]) d.setPos(self.gridToPos(door["pos"])) d.type = "door" d.symbol = 'd' if door["openWith"] == "switches": d.switches = door["switches"] return d except KeyError as e: print "Error in map doors..." exit()