a2p2 0.7.8__tar.gz → 0.7.9__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {a2p2-0.7.8/a2p2.egg-info → a2p2-0.7.9}/PKG-INFO +1 -1
- {a2p2-0.7.8 → a2p2-0.7.9}/a2p2/jmmc/utils.py +4 -29
- {a2p2-0.7.8 → a2p2-0.7.9}/a2p2/version.py +6 -2
- {a2p2-0.7.8 → a2p2-0.7.9/a2p2.egg-info}/PKG-INFO +1 -1
- {a2p2-0.7.8 → a2p2-0.7.9}/LICENSE +0 -0
- {a2p2-0.7.8 → a2p2-0.7.9}/MANIFEST.in +0 -0
- {a2p2-0.7.8 → a2p2-0.7.9}/README.rst +0 -0
- {a2p2-0.7.8 → a2p2-0.7.9}/a2p2/__init__.py +0 -0
- {a2p2-0.7.8 → a2p2-0.7.9}/a2p2/__main__.py +0 -0
- {a2p2-0.7.8 → a2p2-0.7.9}/a2p2/chara/__init__.py +0 -0
- {a2p2-0.7.8 → a2p2-0.7.9}/a2p2/chara/facility.py +0 -0
- {a2p2-0.7.8 → a2p2-0.7.9}/a2p2/chara/gui.py +0 -0
- {a2p2-0.7.8 → a2p2-0.7.9}/a2p2/client.py +0 -0
- {a2p2-0.7.8 → a2p2-0.7.9}/a2p2/facility.py +0 -0
- {a2p2-0.7.8 → a2p2-0.7.9}/a2p2/gui.py +0 -0
- {a2p2-0.7.8 → a2p2-0.7.9}/a2p2/instrument.py +0 -0
- {a2p2-0.7.8 → a2p2-0.7.9}/a2p2/jmmc/__init__.py +0 -0
- {a2p2-0.7.8 → a2p2-0.7.9}/a2p2/jmmc/catalogs.py +0 -0
- {a2p2-0.7.8 → a2p2-0.7.9}/a2p2/jmmc/generated_models.py +0 -0
- {a2p2-0.7.8 → a2p2-0.7.9}/a2p2/jmmc/models.py +0 -0
- {a2p2-0.7.8 → a2p2-0.7.9}/a2p2/jmmc/services.py +0 -0
- {a2p2-0.7.8 → a2p2-0.7.9}/a2p2/jmmc/webservices.py +0 -0
- {a2p2-0.7.8 → a2p2-0.7.9}/a2p2/ob.py +0 -0
- {a2p2-0.7.8 → a2p2-0.7.9}/a2p2/samp.py +0 -0
- {a2p2-0.7.8 → a2p2-0.7.9}/a2p2/utils.py +0 -0
- {a2p2-0.7.8 → a2p2-0.7.9}/a2p2/vlti/__init__.py +0 -0
- {a2p2-0.7.8 → a2p2-0.7.9}/a2p2/vlti/conf/GRAVITY_ditTable.json +0 -0
- {a2p2-0.7.8 → a2p2-0.7.9}/a2p2/vlti/conf/GRAVITY_rangeTable.json +0 -0
- {a2p2-0.7.8 → a2p2-0.7.9}/a2p2/vlti/conf/MATISSE_ditTable.json +0 -0
- {a2p2-0.7.8 → a2p2-0.7.9}/a2p2/vlti/conf/MATISSE_rangeTable.json +0 -0
- {a2p2-0.7.8 → a2p2-0.7.9}/a2p2/vlti/conf/PIONIER_ditTable.json +0 -0
- {a2p2-0.7.8 → a2p2-0.7.9}/a2p2/vlti/conf/PIONIER_rangeTable.json +0 -0
- {a2p2-0.7.8 → a2p2-0.7.9}/a2p2/vlti/facility.py +0 -0
- {a2p2-0.7.8 → a2p2-0.7.9}/a2p2/vlti/gravity.py +0 -0
- {a2p2-0.7.8 → a2p2-0.7.9}/a2p2/vlti/gui.py +0 -0
- {a2p2-0.7.8 → a2p2-0.7.9}/a2p2/vlti/instrument.py +0 -0
- {a2p2-0.7.8 → a2p2-0.7.9}/a2p2/vlti/matisse.py +0 -0
- {a2p2-0.7.8 → a2p2-0.7.9}/a2p2/vlti/pionier.py +0 -0
- {a2p2-0.7.8 → a2p2-0.7.9}/a2p2.egg-info/SOURCES.txt +0 -0
- {a2p2-0.7.8 → a2p2-0.7.9}/a2p2.egg-info/dependency_links.txt +0 -0
- {a2p2-0.7.8 → a2p2-0.7.9}/a2p2.egg-info/entry_points.txt +0 -0
- {a2p2-0.7.8 → a2p2-0.7.9}/a2p2.egg-info/requires.txt +0 -0
- {a2p2-0.7.8 → a2p2-0.7.9}/a2p2.egg-info/top_level.txt +0 -0
- {a2p2-0.7.8 → a2p2-0.7.9}/pyproject.toml +0 -0
- {a2p2-0.7.8 → a2p2-0.7.9}/setup.cfg +0 -0
- {a2p2-0.7.8 → a2p2-0.7.9}/setup.py +0 -0
- {a2p2-0.7.8 → a2p2-0.7.9}/test/test_jmmc_catalog.py +0 -0
- {a2p2-0.7.8 → a2p2-0.7.9}/test/test_jmmc_models.py +0 -0
- {a2p2-0.7.8 → a2p2-0.7.9}/test/test_test.py +0 -0
@@ -27,7 +27,7 @@ logger = logging.getLogger(__name__)
|
|
27
27
|
def requests_retry_session(
|
28
28
|
retries=3,
|
29
29
|
backoff_factor=1.0,
|
30
|
-
status_forcelist=(500, 502, 504)):
|
30
|
+
status_forcelist=(401, 500, 502, 504)):
|
31
31
|
|
32
32
|
adapter = HTTPAdapter()
|
33
33
|
adapter.max_retries = Retry(
|
@@ -79,38 +79,13 @@ class JmmcAPI():
|
|
79
79
|
def _put(self, url, json):
|
80
80
|
return self._request('PUT', url, json)
|
81
81
|
|
82
|
-
def _post(self, url, json):
|
83
|
-
return self._request('POST', url, json)
|
84
|
-
|
85
82
|
def _post(self, url, **kwargs):
|
86
|
-
return self.
|
87
|
-
|
88
|
-
def _request2(self, method, url, **kwargs):
|
89
|
-
logger.info("performing %s request on %s" % (method, self.rootURL+url))
|
90
|
-
r = self.requests_session.request(
|
91
|
-
method, self.rootURL+url, **kwargs)
|
92
|
-
# handle response if any or throw an exception
|
93
|
-
if (r.status_code == 204): # No Content : everything is fine
|
94
|
-
return
|
95
|
-
elif 200 <= r.status_code < 300:
|
96
|
-
if 'Content-Type' in r.headers.keys() and 'application/json' in r.headers['Content-Type']:
|
97
|
-
return r.json()
|
98
|
-
else:
|
99
|
-
return r.content
|
100
|
-
# TODO enhance error handling ? Throw an exception ....
|
101
|
-
error = []
|
102
|
-
error.append("status_code is %s"%r.status_code)
|
103
|
-
if r.reason :
|
104
|
-
error.append(r.reason)
|
105
|
-
if "X-Http-Error-Description" in r.headers.keys():
|
106
|
-
error.append(r.headers["X-Http-Error-Description"])
|
107
|
-
|
108
|
-
raise Exception(error)
|
83
|
+
return self._request('POST', url, **kwargs)
|
109
84
|
|
110
|
-
def _request(self, method, url,
|
85
|
+
def _request(self, method, url, **kwargs):
|
111
86
|
logger.info("performing %s request on %s" % (method, self.rootURL+url))
|
112
87
|
r = self.requests_session.request(
|
113
|
-
method, self.rootURL+url, auth=self.auth,
|
88
|
+
method, self.rootURL+url, auth=self.auth, **kwargs)
|
114
89
|
# handle response if any or throw an exception
|
115
90
|
if (r.status_code == 204): # No Content : everything is fine
|
116
91
|
return
|
@@ -1,4 +1,4 @@
|
|
1
|
-
__version__ = "0.7.
|
1
|
+
__version__ = "0.7.9"
|
2
2
|
|
3
3
|
__release_notes__ = {
|
4
4
|
# "0.1.6": {
|
@@ -23,7 +23,11 @@ __release_notes__ = {
|
|
23
23
|
# "Try to read OB in P2 and send them back to Aspro2 as a new obs",
|
24
24
|
# ],
|
25
25
|
|
26
|
-
"0.7.
|
26
|
+
"0.7.9": {
|
27
|
+
"A2P2": [
|
28
|
+
"catalogs : remove duplicated code and force auth on POST requests",
|
29
|
+
],
|
30
|
+
},"0.7.8": {
|
27
31
|
"A2P2": [
|
28
32
|
"catalogs : use cache for dataFrame() so we can modify it (was recreated from astropy table on each call)",
|
29
33
|
],
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|