Ejemplo n.º 1
0
"""

# standard library
import os

# local
from utils.choices import choices


def get_this_package():
    """
    Returns the name of the package in which this module resides.
    """
    current_path = os.path.dirname(__file__)
    return os.path.basename(current_path)


# The name of this package, which contains subpackages for specific social media
# platforms.
PLATFORMS_PACKAGE = get_this_package()

# Packages for social media platforms that can be chosen as a Reservoir.
ABSOLUTE_PATH = os.path.dirname(os.path.abspath(__file__))
PLATFORM_CHOICES = choices.get_package_choices(ABSOLUTE_PATH)

# Standard name for a module in a platform package that handles
# queries to APIs. These modules contain the classes associated with
# Endpoints.
HANDLERS_MODULE = 'handlers'

Ejemplo n.º 2
0
The name of this package, which contains subpackages for specific
backends.
"""

ENGINE_MODULE = 'engine'
"""|str|

Standard name for a module in an `engines` subpackage that contains an
|Engine| sublclass used to interact with a data store.
"""

CURRENT_PATH = os.path.dirname(os.path.abspath(__file__))
"""|str|

Path containing `engines` subpackages for particular backends.
"""

BACKEND_CHOICES = choices.get_package_choices(CURRENT_PATH)
"""|tuple| of |tuple|

Backend choices, based on `engines` subpackages. Each item provides a
(value, label) choice for a package, which can be used in a `choices`
argument for a CharField in a Django Model, e.g.::

    (
        ('elasticsearch', 'elasticsearch'),
        ('mongodb', 'mongodb'),
    )

"""