def unpack(self, json_data): result = json.loads(json_data) if result and result['params']: self.term = DictHelper.find('params.term', result) self.target = DictHelper.find('params.target', result) else: return None if self.target == Target.tostring(0): self.__class__ = ObjectParams else: self.__class__ = CatalogParams return self.unpack(json_data)
def unpack(self, json_data): result = json.loads(json_data) if result and result['params']: self.obsolete_catalogs = DictHelper.find('params.obsolete_catalogs', result) else: return None return self
def unpack(self, json_data): result = json.loads(json_data) if result and result['params']: self.exact = DictHelper.find('params.exact', result) self.cone = DictHelper.find('params.cone', result) if self.cone: self.radius = DictHelper.find('params.radius', result) coordinates_str = DictHelper.find('params.coordinates', result) if coordinates_str: self.coordinates = CoordinatesConverter.convert(coordinates_str) self.epoch = DictHelper.find('params.epoch', result) self.equinox = DictHelper.find('params.equinox', result) else: return None return self
def get_section(self, section): return DictHelper.find(section, self)
def find_by_path(self, path): return DictHelper.find(path, self)
def find(self, key): return DictHelper.find(key, self)