How to use the cheroot.cli.BindLocation function in cheroot

To help you get started, we’ve selected a few cheroot examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cherrypy / cheroot / cheroot / cli.py View on Github external
class TCPSocket(BindLocation):
    """TCPSocket."""

    def __init__(self, address, port):
        """Initialize.

        Args:
            address (str): Host name or IP address
            port (int): TCP port number
        """
        self.bind_addr = address, port


class UnixSocket(BindLocation):
    """UnixSocket."""

    def __init__(self, path):
        """Initialize."""
        self.bind_addr = path


class AbstractSocket(BindLocation):
    """AbstractSocket."""

    def __init__(self, addr):
        """Initialize."""
        self.bind_addr = '\0{}'.format(self.abstract_socket)


class Application:
github cherrypy / cheroot / cheroot / cli.py View on Github external
Args:
            address (str): Host name or IP address
            port (int): TCP port number
        """
        self.bind_addr = address, port


class UnixSocket(BindLocation):
    """UnixSocket."""

    def __init__(self, path):
        """Initialize."""
        self.bind_addr = path


class AbstractSocket(BindLocation):
    """AbstractSocket."""

    def __init__(self, addr):
        """Initialize."""
        self.bind_addr = '\0{}'.format(self.abstract_socket)


class Application:
    """Application."""

    @classmethod
    def resolve(cls, full_path):
        """Read WSGI app/Gateway path string and import application module."""
        mod_path, _, app_path = full_path.partition(':')
        app = getattr(import_module(mod_path), app_path or 'application')
github cherrypy / cheroot / cheroot / cli.py View on Github external
address (str): Host name or IP address
            port (int): TCP port number

        """
        self.bind_addr = address, port


class UnixSocket(BindLocation):
    """UnixSocket."""

    def __init__(self, path):
        """Initialize."""
        self.bind_addr = path


class AbstractSocket(BindLocation):
    """AbstractSocket."""

    def __init__(self, abstract_socket):
        """Initialize."""
        self.bind_addr = '\x00{}'.format(abstract_socket)


class Application:
    """Application."""

    @classmethod
    def resolve(cls, full_path):
        """Read WSGI app/Gateway path string and import application module."""
        mod_path, _, app_path = full_path.partition(':')
        app = getattr(import_module(mod_path), app_path or 'application')
        # suppress the `TypeError` exception, just in case `app` is not a class
github cherrypy / cheroot / cheroot / cli.py View on Github external
import six

from . import server
from . import wsgi
from ._compat import suppress


__metaclass__ = type


class BindLocation:
    """A class for storing the bind location for a Cheroot instance."""


class TCPSocket(BindLocation):
    """TCPSocket."""

    def __init__(self, address, port):
        """Initialize.

        Args:
            address (str): Host name or IP address
            port (int): TCP port number

        """
        self.bind_addr = address, port


class UnixSocket(BindLocation):
    """UnixSocket."""
github cherrypy / cheroot / cheroot / cli.py View on Github external
class TCPSocket(BindLocation):
    """TCPSocket."""

    def __init__(self, address, port):
        """Initialize.

        Args:
            address (str): Host name or IP address
            port (int): TCP port number

        """
        self.bind_addr = address, port


class UnixSocket(BindLocation):
    """UnixSocket."""

    def __init__(self, path):
        """Initialize."""
        self.bind_addr = path


class AbstractSocket(BindLocation):
    """AbstractSocket."""

    def __init__(self, abstract_socket):
        """Initialize."""
        self.bind_addr = '\x00{}'.format(abstract_socket)


class Application:
github cherrypy / cheroot / cheroot / cli.py View on Github external
import contextlib

import six

from . import server
from . import wsgi


__metaclass__ = type


class BindLocation:
    """A class for storing the bind location for a Cheroot instance."""


class TCPSocket(BindLocation):
    """TCPSocket."""

    def __init__(self, address, port):
        """Initialize.

        Args:
            address (str): Host name or IP address
            port (int): TCP port number
        """
        self.bind_addr = address, port


class UnixSocket(BindLocation):
    """UnixSocket."""

    def __init__(self, path):