<s> """<STR_LIT>""" <EOL> __author__ = '<STR_LIT>' <EOL> import rpc4django <EOL> from services . configuration . models import segments as segment_models <EOL> from services . configuration . models import tle as tle_models <EOL> from services . configuration . models . celestrak import CelestrakDatabase <EOL> from services . configuration . jrpc . serializers import tle as tle_serializers <EOL> from website import settings as satnet_settings <EOL> @ rpc4django . rpcmethod ( <EOL> name = '<STR_LIT>' , <EOL> signature = [ ] , <EOL> login_required = satnet_settings . JRPC_LOGIN_REQUIRED <EOL> ) <EOL> def get_celestrak_sections ( ) : <EOL> """<STR_LIT>""" <EOL> return CelestrakDatabase . CELESTRAK_SELECT_SECTIONS <EOL> @ rpc4django . rpcmethod ( <EOL> name = '<STR_LIT>' , <EOL> signature = [ '<STR_LIT>' ] , <EOL> login_required = satnet_settings . JRPC_LOGIN_REQUIRED <EOL> ) <EOL> def get_celestrak_resource ( subsection ) : <EOL> """<STR_LIT>""" <EOL> url = CelestrakDatabase . CELESTRAK_RESOURCES [ subsection ] <EOL> tles = tle_models . TwoLineElement . objects . filter ( source = url ) . all ( ) <EOL> return tle_serializers . TleSerializer . serialize_resource ( url , tles ) <EOL> @ rpc4django . rpcmethod ( <EOL> name = '<STR_LIT>' , <EOL> signature = [ '<STR_LIT>' ] , <EOL> login_required = satnet_settings . JRPC_LOGIN_REQUIRED <EOL> ) <EOL> def get_spacecraft_tle ( spacecraft_id ) : <EOL> """<STR_LIT>""" <EOL> sc = segment_models . Spacecraft . objects . get ( identifier = spacecraft_id ) <EOL> return tle_serializers . TleSerializer . serialize_tle ( sc ) </s>
