def __init__(self, url, xml, cookies, auth=None, timeout=30):
    super(WebCoverageService_1_0_0, self).__init__(auth)
    self.version = '1.0.0'
    self.url = url
    self.cookies = cookies
    self.timeout = timeout
    reader = WCSCapabilitiesReader(self.version, self.cookies, self.auth)
    if xml:
        self._capabilities = reader.readString(xml)
    else:
        self._capabilities = reader.read(self.url, self.timeout)
    se = self._capabilities.find('ServiceException')
    if (se is not None):
        err_message = str(se.text).strip()
        raise ServiceException(err_message, xml)
    self.updateSequence = self._capabilities.attrib.get('updateSequence')
    subelem = self._capabilities.find(ns('Service'))
    self.identification = ServiceIdentification(subelem)
    subelem = self._capabilities.find((ns('Service/') + ns('responsibleParty')))
    self.provider = ServiceProvider(subelem)
    self.operations = []
    for elem in self._capabilities.find((ns('Capability/') + ns('Request')))[:]:
        self.operations.append(OperationMetadata(elem))
    self.contents = {}
    for elem in self._capabilities.findall((ns('ContentMetadata/') + ns('CoverageOfferingBrief'))):
        cm = ContentMetadata(elem, self)
        self.contents[cm.id] = cm
    if (self.contents == {}):
        for elem in self._capabilities.findall((ns('ContentMetadata/') + ns('ContentOfferingBrief'))):
            cm = ContentMetadata(elem, self)
            self.contents[cm.id] = cm
    self.exceptions = [f.text for f in self._capabilities.findall('Capability/Exception/Format')]
def __init__(self, url, xml, cookies, auth=None, timeout=30):
    super(WebCoverageService_1_0_0, self).__init__(auth)
    self.version = '1.0.0'
    self.url = url
    self.cookies = cookies
    self.timeout = timeout
    reader = WCSCapabilitiesReader(self.version, self.cookies, self.auth)
    if xml:
        self._capabilities = reader.readString(xml)
    else:
        self._capabilities = reader.read(self.url, self.timeout)
    se = self._capabilities.find('ServiceException')
    if (se is not None):
        err_message = str(se.text).strip()
        raise ServiceException(err_message, xml)
    self.updateSequence = self._capabilities.attrib.get('updateSequence')
    subelem = self._capabilities.find(ns('Service'))
    self.identification = ServiceIdentification(subelem)
    subelem = self._capabilities.find((ns('Service/') + ns('responsibleParty')))
    self.provider = ServiceProvider(subelem)
    self.operations = []
    for elem in self._capabilities.find((ns('Capability/') + ns('Request')))[:]:
        self.operations.append(OperationMetadata(elem))
    self.contents = {}
    for elem in self._capabilities.findall((ns('ContentMetadata/') + ns('CoverageOfferingBrief'))):
        cm = ContentMetadata(elem, self)
        self.contents[cm.id] = cm
    if (self.contents == {}):
        for elem in self._capabilities.findall((ns('ContentMetadata/') + ns('ContentOfferingBrief'))):
            cm = ContentMetadata(elem, self)
            self.contents[cm.id] = cm
    self.exceptions = [f.text for f in self._capabilities.findall('Capability/Exception/Format')]