File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 4343
4444BASE_URL = "https://www.space-track.org/"
4545
46+ REQUEST_CLASS_DEPRECATION_MSG = (
47+ "The {class_} request class is deprecated and scheduled to be "
48+ "removed. Visit https://www.space-track.org for more information."
49+ )
50+
4651
4752class AuthenticationError (Exception ):
4853 """Space-Track authentication error."""
@@ -242,6 +247,14 @@ class SpaceTrackClient:
242247 ("dirs" , "publicfiles" ): set (),
243248 ("download" , "publicfiles" ): set (),
244249 }
250+ deprecated_controllers = {
251+ "basicspacedata" : {
252+ "tle" ,
253+ "tle_latest" ,
254+ "tle_publish" ,
255+ "omm" ,
256+ },
257+ }
245258 param_fields = {
246259 ("download" , "publicfiles" ): {"name" },
247260 }
@@ -440,6 +453,16 @@ def _generic_request_generator(
440453 valid_params = self .param_fields .get ((class_ , controller ), set ())
441454 params = dict ()
442455
456+ if (
457+ controller in self .deprecated_controllers
458+ and class_ in self .deprecated_controllers [controller ]
459+ ):
460+ warnings .warn (
461+ REQUEST_CLASS_DEPRECATION_MSG .format (class_ = class_ ),
462+ DeprecationWarning ,
463+ stacklevel = 4 ,
464+ )
465+
443466 url = f"{ controller } /query/class/{ class_ } "
444467
445468 for key , value in kwargs .items ():
You can’t perform that action at this time.
0 commit comments