Skip to content

Commit e9147ea

Browse files
jaymedinaburnout87
authored andcommitted
the configuration variables are now class attributes to make patching possible
1 parent ce33b8b commit e9147ea

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

astroquery/mast/discovery_portal.py

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -116,25 +116,25 @@ class PortalAPI(BaseQuery):
116116
Should be used to facilitate all Portal API queries.
117117
"""
118118

119-
def __init__(self, session=None):
119+
MAST_REQUEST_URL = conf.server + "/api/v0/invoke"
120+
COLUMNS_CONFIG_URL = conf.server + "/portal/Mashup/Mashup.asmx/columnsconfig"
121+
MAST_DOWNLOAD_URL = conf.server + "/api/v0.1/Download/file"
122+
MAST_BUNDLE_URL = conf.server + "/api/v0.1/Download/bundle"
120123

121-
super(PortalAPI, self).__init__()
122-
if session:
123-
self._session = session
124+
TIMEOUT = conf.timeout
125+
PAGESIZE = conf.pagesize
124126

125-
self.MAST_REQUEST_URL = conf.server + "/api/v0/invoke"
126-
self.COLUMNS_CONFIG_URL = conf.server + "/portal/Mashup/Mashup.asmx/columnsconfig"
127-
self.MAST_DOWNLOAD_URL = conf.server + "/api/v0.1/Download/file"
128-
self.MAST_BUNDLE_URL = conf.server + "/api/v0.1/Download/bundle"
127+
_column_configs = dict()
128+
_current_service = None
129129

130-
self.TIMEOUT = conf.timeout
131-
self.PAGESIZE = conf.pagesize
130+
tess_all_name = 'Mast.Catalogs.All.Tic'
131+
dd_all_name = 'Mast.Catalogs.All.Disk.Detective'
132132

133-
self._column_configs = dict()
134-
self._current_service = None
133+
def __init__(self, session=None):
135134

136-
self.tess_all_name = 'Mast.Catalogs.All.Tic'
137-
self.dd_all_name = 'Mast.Catalogs.All.Disk.Detective'
135+
super(PortalAPI, self).__init__()
136+
if session:
137+
self._session = session
138138

139139
def _request(self, method, url, params=None, data=None, headers=None,
140140
files=None, stream=False, auth=None, retrieve_all=True):
@@ -485,6 +485,7 @@ def _get_columnsconfig_metadata(self, colconf_name):
485485
headers = {"User-Agent": self._session.headers["User-Agent"],
486486
"Content-type": "application/x-www-form-urlencoded",
487487
"Accept": "text/plain"}
488+
488489
response = self._request("POST", self.COLUMNS_CONFIG_URL,
489490
data=("colConfigId={}".format(colconf_name)), headers=headers)
490491

0 commit comments

Comments
 (0)