Skip to content

Commit

Permalink
Better naming for modules (Python 3 compatible)
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Nov 6, 2019
1 parent 7b726fb commit af325c4
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions service/src/service_utils/__init__.py
Expand Up @@ -34,19 +34,19 @@
__license__ = "Apache License, Version 2.0"
""" The license for the module """

from . import async
from . import asynchronous
from . import exceptions
from . import sync
from . import synchronous
from . import system
from . import threads

from .async import SelectPolling, EpollPolling, KqueuePolling, Connection
from .asynchronous import SelectPolling, EpollPolling, KqueuePolling, Connection
from .exceptions import ServiceUtilsException, SocketProviderNotFound, SocketUpgraderNotFound,\
ServerRequestTimeout, ClientRequestTimeout, ServerResponseTimeout, ClientResponseTimeout,\
RequestClosed, PortStarvationReached, ConnectionChangeFailure
from .sync import AbstractServiceConnectionHandler, AbstractServiceConnectionlessHandler
from .synchronous import AbstractServiceConnectionHandler, AbstractServiceConnectionlessHandler
from .system import ServiceUtils
from .threads import ServiceAcceptingThread, ServiceExecutionThread

from .async import AbstractService as AbstractServiceAsync
from .sync import AbstractService as AbstractServiceSync
from .asynchronous import AbstractService as AbstractServiceAsync
from .synchronous import AbstractService as AbstractServiceSync
Expand Up @@ -119,10 +119,10 @@ class AbstractService(object):
"""

service_utils = None
""" The service utils """
""" The service utils system reference """

service_utils_plugin = None
""" The service utils plugin """
""" The service utils plugin reference """

stop_flag = False
""" The flag that controls the execution of the main loop
Expand Down
File renamed without changes.
10 changes: 5 additions & 5 deletions service/src/service_utils/system.py
Expand Up @@ -41,8 +41,8 @@

import colony

from . import sync
from . import async
from . import synchronous
from . import asynchronous
from . import exceptions

PORT_RANGES = (
Expand All @@ -52,8 +52,8 @@
""" The ranges of port available for services """

SERVICE_CLASSES_MAP = {
"sync" : sync.AbstractService,
"async" : async.AbstractService
"sync" : synchronous.AbstractService,
"async" : asynchronous.AbstractService
}
""" The map containing the various abstract service types """

Expand Down Expand Up @@ -101,7 +101,7 @@ def generate_service(self, parameters):
# retrieves the service type from the parameters in order
# to retrieve the proper (abstract) service class
service_type = parameters.get("service_type", "sync")
service_class = SERVICE_CLASSES_MAP.get(service_type, sync.AbstractService)
service_class = SERVICE_CLASSES_MAP.get(service_type, synchronous.AbstractService)

# creates the service "instance" using the abstract service class
service_instance = service_class(self, self.plugin, parameters)
Expand Down

0 comments on commit af325c4

Please sign in to comment.