/usr/lib/python3/dist-packages/owslib/waterml/wml11.py is in python3-owslib 0.16.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | from __future__ import (absolute_import, division, print_function)
from owslib.waterml.wml import SitesResponse, TimeSeriesResponse, VariablesResponse, namespaces
from owslib.etree import etree, ElementType
def ns(namespace):
return namespaces.get(namespace)
class WaterML_1_1(object):
def __init__(self, element):
if isinstance(element, ElementType):
self._root = element
else:
self._root = etree.fromstring(element)
if hasattr(self._root, 'getroot'):
self._root = self._root.getroot()
self._ns = 'wml1.1'
@property
def response(self):
try:
if self._root.tag == str(ns(self._ns) + 'variablesResponse'):
return VariablesResponse(self._root, self._ns)
elif self._root.tag == str(ns(self._ns) + 'timeSeriesResponse'):
return TimeSeriesResponse(self._root, self._ns)
elif self._root.tag == str(ns(self._ns) + 'sitesResponse'):
return SitesResponse(self._root, self._ns)
except:
raise
raise ValueError('Unable to determine response type from xml')
|