# Path: gloss/core/settings_utils.py
# def set_settings_env(app_name):
# def get_settings_mod():


import os
from zope.interface import implements
from zope.interface.verify import verifyClass
from twisted.python import usage, reflect
from twisted.plugin import IPlugin
from twisted.internet import endpoints
from twisted.application.service import IServiceMaker, MultiService
from twisted.application import internet
from gloss.core import settings_utils
        from twisted.internet import reactor
        from txHL7.mllp import IHL7Receiver, MLLPFactory
        from gloss.conf import settings

DEFAULT_RECEIVER = "txHL7.receiver.LoggingReceiver"


class Options(usage.Options):
    """Define the options accepted by the ``twistd multiple_mllp`` plugin"""
    synopsis = "[mllp options]"

    optParameters = [
        ['receiver', 'r', DEFAULT_RECEIVER, 'A txHL7.receiver.IHL7Receiver subclass to handle messages.'],
    ]

    longdesc = """\
Starts an MLLP server. If no arguments are specified,
it will be a demo server that logs and ACKs each message received."""


class MLLPMultiServiceMaker(object):
    """Service maker for the MLLP server."""
    implements(IServiceMaker, IPlugin)
    tapname = "multiple_mllp"
    description = "HL7 MLLP that listens to multiple ports."
    options = Options

    def makeService(self, options):
        """Construct a server using MLLPFactory.

        :rtype: :py:class:`twisted.application.internet.StreamServerEndpointService`
        """
        app_to_run = options['app']

# Path: gloss/core/settings_utils.py
# def set_settings_env(app_name):
# def get_settings_mod():


# Path: twisted/plugins/multiple_mllp_plugin.py
import os
from zope.interface import implements
from zope.interface.verify import verifyClass
from twisted.python import usage, reflect
from twisted.plugin import IPlugin
from twisted.internet import endpoints
from twisted.application.service import IServiceMaker, MultiService
from twisted.application import internet
from gloss.core import settings_utils
        from twisted.internet import reactor
        from txHL7.mllp import IHL7Receiver, MLLPFactory
        from gloss.conf import settings


DEFAULT_RECEIVER = "txHL7.receiver.LoggingReceiver"


class Options(usage.Options):
    """Define the options accepted by the ``twistd multiple_mllp`` plugin"""
    synopsis = "[mllp options]"

    optParameters = [
        ['receiver', 'r', DEFAULT_RECEIVER, 'A txHL7.receiver.IHL7Receiver subclass to handle messages.'],
    ]

    longdesc = """\
Starts an MLLP server. If no arguments are specified,
it will be a demo server that logs and ACKs each message received."""


class MLLPMultiServiceMaker(object):
    """Service maker for the MLLP server."""
    implements(IServiceMaker, IPlugin)
    tapname = "multiple_mllp"
    description = "HL7 MLLP that listens to multiple ports."
    options = Options

    def makeService(self, options):
        """Construct a server using MLLPFactory.

        :rtype: :py:class:`twisted.application.internet.StreamServerEndpointService`
        """
        app_to_run = options['app']

        settings_utils.set_settings_env(app_to_run)