# Path: birdy/cli/misc.py
# def get_ssl_verify():  # noqa: D103
#     value = os.environ.get("WPS_SSL_VERIFY", "True")
#     if value.lower() == "true":
#         verify = True
#     elif value.lower() == "false":
#         import urllib3
# 
#         urllib3.disable_warnings()
#         click.echo(
#             "Warning: Unverified HTTPS request is being made."
#             " Adding certificate verification is strongly advised.\n"
#         )
#         verify = False
#     else:
#         verify = value
#     return verify
# 
# Path: birdy/cli/types.py
# COMPLEX = ComplexParamType()
# 
# Path: birdy/exceptions.py
# class ConnectionError(click.ClickException):  # noqa: D101
#     pass


import os
import click
from collections import OrderedDict
from jinja2 import Environment, PackageLoader
from owslib.wps import WebProcessingService
from requests.exceptions import SSLError
from birdy.cli.misc import get_ssl_verify
from birdy.cli.types import COMPLEX
from birdy.exceptions import ConnectionError
      A WPS DescribeProcess response with "identifier=all" for testing.
    """

    def __init__(self, name=None, url=None, caps_xml=None, desc_xml=None, **attrs):
        click.MultiCommand.__init__(self, name, **attrs)
        self.url = os.environ.get("WPS_SERVICE") or url
        self.verify = get_ssl_verify()
        self.caps_xml = caps_xml
        self.desc_xml = desc_xml
        self._wps = None
        self.commands = OrderedDict()

    @property
    def wps(self):  # noqa: D102
        if self._wps is None:
            language = self.context_settings["obj"].get("language")
            self._wps = WebProcessingService(
                self.url, verify=self.verify, skip_caps=True, language=language
            )
        return self._wps

    def _update_commands(self):  # noqa: D102
        if not self.commands:
            try:
                self.wps.getcapabilities(xml=self.caps_xml)
            except SSLError:
                raise ConnectionError(
                    "SSL verfication of server certificate failed. Set WPS_SSL_VERIFY=false."
                )
            except Exception as e:

# Path: birdy/cli/misc.py
# def get_ssl_verify():  # noqa: D103
#     value = os.environ.get("WPS_SSL_VERIFY", "True")
#     if value.lower() == "true":
#         verify = True
#     elif value.lower() == "false":
#         import urllib3
# 
#         urllib3.disable_warnings()
#         click.echo(
#             "Warning: Unverified HTTPS request is being made."
#             " Adding certificate verification is strongly advised.\n"
#         )
#         verify = False
#     else:
#         verify = value
#     return verify
# 
# Path: birdy/cli/types.py
# COMPLEX = ComplexParamType()
# 
# Path: birdy/exceptions.py
# class ConnectionError(click.ClickException):  # noqa: D101
#     pass


# Path: birdy/cli/base.py
import os
import click
from collections import OrderedDict
from jinja2 import Environment, PackageLoader
from owslib.wps import WebProcessingService
from requests.exceptions import SSLError
from birdy.cli.misc import get_ssl_verify
from birdy.cli.types import COMPLEX
from birdy.exceptions import ConnectionError

      A WPS DescribeProcess response with "identifier=all" for testing.
    """

    def __init__(self, name=None, url=None, caps_xml=None, desc_xml=None, **attrs):
        click.MultiCommand.__init__(self, name, **attrs)
        self.url = os.environ.get("WPS_SERVICE") or url
        self.verify = get_ssl_verify()
        self.caps_xml = caps_xml
        self.desc_xml = desc_xml
        self._wps = None
        self.commands = OrderedDict()

    @property
    def wps(self):  # noqa: D102
        if self._wps is None:
            language = self.context_settings["obj"].get("language")
            self._wps = WebProcessingService(
                self.url, verify=self.verify, skip_caps=True, language=language
            )
        return self._wps

    def _update_commands(self):  # noqa: D102
        if not self.commands:
            try:
                self.wps.getcapabilities(xml=self.caps_xml)
            except SSLError:
                raise ConnectionError(
                    "SSL verfication of server certificate failed. Set WPS_SSL_VERIFY=false."
                )
            except Exception as e:

                raise ConnectionError(