0001-wcs_api-adapt-to-change-in-formdefs-API-fixes-20383.patch
wcs_olap/wcs_api.py | ||
---|---|---|
2 | 2 |
import urlparse |
3 | 3 |
import urllib |
4 | 4 |
import isodate |
5 |
import logging |
|
6 | ||
5 | 7 | |
6 | 8 |
from . import signature |
7 | 9 | |
8 | 10 | |
11 |
logger = logging.getLogger(__name__) |
|
12 | ||
13 | ||
9 | 14 |
class WcsApiError(Exception): |
10 | 15 |
pass |
11 | 16 | |
... | ... | |
217 | 222 | |
218 | 223 |
@property |
219 | 224 |
def formdefs(self): |
220 |
return [FormDef(wcs_api=self, **d) for d in self.get_json(self.formdefs_url) |
|
225 |
result = self.get_json(self.formdefs_url) |
|
226 |
if isinstance(result, dict): |
|
227 |
if result['err'] == 0: |
|
228 |
data = result['data'] |
|
229 |
else: |
|
230 |
logger.error(u'could not retrieve formdefs from %s, err_desc: %s', |
|
231 |
self.formdefs_url, result.get('err_desc')) |
|
232 |
return [] |
|
233 |
else: |
|
234 |
data = result |
|
235 |
return [FormDef(wcs_api=self, **d) for d in data |
|
221 | 236 |
if not self.slugs or d['slug'] in self.slugs] |
222 | 237 | |
223 | 238 |
@property |
224 |
- |