def parse_capabilities_url(url, version='1.1.1'): try: capabilities_url = wms_capapilities_url(url, version) capabilities_response = open_url(capabilities_url) except HTTPClientError, ex: log_error('ERROR: %s', ex.args[0]) sys.exit(1)
def parse_capabilities(capabilities_url): try: capabilities_url = wms_111_cap_url(capabilities_url) capabilities_response = open_url(capabilities_url) except HTTPClientError, ex: log_error('ERROR: %s', ex.args[0]) sys.exit(1)
def parse_capabilities_url(url, version='1.1.1'): try: capabilities_url = wms_capapilities_url(url, version) capabilities_response = open_url(capabilities_url) except HTTPClientError as ex: log_error('ERROR: %s', ex.args[0]) sys.exit(1) # after parsing capabilities_response will be empty, therefore cache it capabilities = BytesIO(capabilities_response.read()) return parse_capabilities(capabilities, version=version)
def parse_capabilities(capabilities_url): try: capabilities_response = open_url(capabilities_url) except HTTPClientError, ex: log_error('ERROR: %s', ex.args[0]) sys.exit(1)
def download_capabilities(url): capabilities_url = wms_capapilities_url(url) return open_url(capabilities_url)