Changeset 602
- Timestamp:
- 12/20/06 08:22:41
- Files:
-
- OWSLib/trunk/CREDITS.txt (moved) (moved from OWSLib/trunk/AUTHORS.txt) (1 diff)
- OWSLib/trunk/owslib/interfaces.py (modified) (2 diffs)
- OWSLib/trunk/owslib/wfs.py (modified) (1 diff)
- OWSLib/trunk/owslib/wms.py (modified) (2 diffs)
- OWSLib/trunk/tests/JPLCapabilities.txt (modified) (1 diff)
- OWSLib/trunk/tests/MapServerWFSCapabilities.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
OWSLib/trunk/CREDITS.txt
r599 r602 2 2 Julien Anguenot <ja@nuxeo.com> 3 3 Kai Hanninen <kai.hanninen@mbconcert.fi> 4 4 Jo Walsh <jo@frot.org> OWSLib/trunk/owslib/interfaces.py
r514 r602 107 107 """ 108 108 109 class IContactMetadata: 110 """OO-interface to OWS metadata. 111 112 Properties 113 ---------- 114 name : string 115 organization : string 116 address : string 117 city : string 118 region : string 119 postcode : string 120 country : string 121 email : string 122 """ 123 109 124 class IMethodMetadata: 110 125 """OO-interface to WMS metadata. … … 151 166 """ 152 167 168 OWSLib/trunk/owslib/wfs.py
r523 r602 176 176 for elem in self._root.findall(nspath('FeatureTypeList/FeatureType')): 177 177 self.contents.append(ContentMetadata(elem, top)) 178 178 179 # keywords 180 self.keywords = [] 181 182 self.provider = None 183 184 179 185 def getContentByName(self, name): 180 186 """Return a named content item.""" OWSLib/trunk/owslib/wms.py
r526 r602 194 194 for elem in self._root.findall('Capability/Layer/Layer'): 195 195 self.contents.append(ContentMetadata(elem, top)) 196 196 197 # keywords 198 self.keywords = [f.text for f in self._root.findall('Service/KeywordList/Keyword')] 199 200 # contact person 201 self.contact = ContactMetadata(self._root.find('Service/ContactInformation')) 202 197 203 def getContentByName(self, name): 198 204 """Return a named content item.""" … … 280 286 methods.append((verb.tag, {'url': url})) 281 287 self.methods = dict(methods) 282 288 289 290 class ContactMetadata: 291 """Abstraction for contact details advertised in GetCapabilities. 292 """ 293 294 def __init__(self, elem): 295 self.name = elem.find('ContactPersonPrimary/ContactPerson').text 296 self.organization = elem.find('ContactPersonPrimary/ContactOrganization').text 297 address = elem.find('ContactAddress') 298 if address is not None: 299 try: 300 self.address = address.find('Address').text 301 self.city = address.find('City').text 302 self.region = address.find('StateOrProvince').text 303 self.postcode = address.find('Postcode').text 304 self.country = address.find('Country').text 305 except: pass 306 self.email = elem.find('ContactElectronicMailAddress').text 307 283 308 284 309 # Deprecated classes follow OWSLib/trunk/tests/JPLCapabilities.txt
r511 r602 14 14 >>> wms.capabilities.service 15 15 'OGC:WMS' 16 >>> wms.capabilities.versions 17 ['1.1.1'] 16 18 >>> wms.capabilities.title 17 19 'JPL Global Imagery Service' 20 >>> wms.capabilities.abstract 21 '' 22 >>> wms.capabilities.link 23 'http://' 24 >>> wms.capabilities.keywords 25 [] 26 >>> wms.capabilities.access 27 {'fees': '', 'constraints': ''} 28 >>> wms.capabilities.provider 29 {'name': 'x', 'link': '', 'email': ''} 18 30 19 31 Test available content layers OWSLib/trunk/tests/MapServerWFSCapabilities.txt
r515 r602 13 13 >>> wfs.capabilities.service 14 14 'MapServer WFS' 15 >>> wfs.capabilities.versions 16 ['1.1.1'] 15 17 >>> wfs.capabilities.title 16 18 'Bird Studies Canada WMS/WFS Server' 19 >>> wfs.capabilities.abstract 20 '' 21 >>> wfs.capabilities.link 22 'http://' 23 >>> wfs.capabilities.keywords 24 [] 25 >>> wfs.capabilities.access 26 {'fees': '', 'constraints': ''} 27 >>> wfs.capabilities.provider 28 {'name': 'x', 'link': '', 'email': ''} 17 29 18 30 Test available content layers
