示例#1
0
文件: params.py 项目: Civa/Zenith
    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)
示例#2
0
文件: params.py 项目: Civa/Zenith
    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
示例#3
0
文件: params.py 项目: Civa/Zenith
    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
示例#4
0
文件: vo_config.py 项目: Civa/Zenith
 def get_section(self, section):
     return DictHelper.find(section, self)
示例#5
0
文件: vo_config.py 项目: Civa/Zenith
 def find_by_path(self, path):
     return DictHelper.find(path, self)
示例#6
0
文件: vo_config.py 项目: Civa/Zenith
 def find(self, key):
     return DictHelper.find(key, self)