Exemplo n.º 1
0
def autodiscover():
    """
    Auto-discovers files that should be found by fobi.
    """
    # For Python 3 we need to increase the recursion limit, otherwise things
    # break. What we want is to set the recursion limit back to its' initial
    # value after all plugins have been discovered.
    recursion_limit = 1500
    default_recursion_limit = sys.getrecursionlimit()

    if six.PY3 and recursion_limit > default_recursion_limit:
        sys.setrecursionlimit(recursion_limit)

    FORM_ELEMENT_PLUGINS_MODULE_NAME = get_setting(
        'FORM_ELEMENT_PLUGINS_MODULE_NAME')
    FORM_HANDLER_PLUGINS_MODULE_NAME = get_setting(
        'FORM_HANDLER_PLUGINS_MODULE_NAME')
    THEMES_MODULE_NAME = get_setting('THEMES_MODULE_NAME')
    FORM_CALLBACKS_MODULE_NAME = get_setting('FORM_CALLBACKS_MODULE_NAME')

    FORM_IMPORTER_PLUGINS_MODULE_NAME = get_setting(
        'FORM_IMPORTER_PLUGINS_MODULE_NAME')

    # Discover modules
    autodiscover_modules(FORM_ELEMENT_PLUGINS_MODULE_NAME)
    autodiscover_modules(FORM_HANDLER_PLUGINS_MODULE_NAME)
    autodiscover_modules(THEMES_MODULE_NAME)
    autodiscover_modules(FORM_CALLBACKS_MODULE_NAME)

    # Do not yet discover form importers
    autodiscover_modules(FORM_IMPORTER_PLUGINS_MODULE_NAME)

    if six.PY3 and recursion_limit > default_recursion_limit:
        sys.setrecursionlimit(default_recursion_limit)
Exemplo n.º 2
0
def autodiscover():
    """
    Autodiscovers files that should be found by fobi.
    """
    FORM_ELEMENT_PLUGINS_MODULE_NAME = get_setting(
        'FORM_ELEMENT_PLUGINS_MODULE_NAME'
        )
    FORM_HANDLER_PLUGINS_MODULE_NAME = get_setting(
        'FORM_HANDLER_PLUGINS_MODULE_NAME'
        )
    THEMES_MODULE_NAME = get_setting(
        'THEMES_MODULE_NAME'
        )
    FORM_CALLBACKS_MODULE_NAME = get_setting(
        'FORM_CALLBACKS_MODULE_NAME'
        )

    #FORM_IMPORTER_PLUGINS_MODULE_NAME = get_setting(
    #    'FORM_IMPORTER_PLUGINS_MODULE_NAME'
    #    )

    # Discover modules
    autodiscover_modules(FORM_ELEMENT_PLUGINS_MODULE_NAME)
    autodiscover_modules(FORM_HANDLER_PLUGINS_MODULE_NAME)
    autodiscover_modules(THEMES_MODULE_NAME)
    autodiscover_modules(FORM_CALLBACKS_MODULE_NAME)
Exemplo n.º 3
0
def autodiscover():
    """
    Auto-discovers files that should be found by fobi.
    """
    # For Python 3 we need to increase the recursion limit, otherwise things
    # break. What we want is to set the recursion limit back to its' initial
    # value after all plugins have been discovered.
    recursion_limit = 1500
    default_recursion_limit = sys.getrecursionlimit()

    if six.PY3 and recursion_limit > default_recursion_limit:
        sys.setrecursionlimit(recursion_limit)

    FORM_ELEMENT_PLUGINS_MODULE_NAME = get_setting(
        'FORM_ELEMENT_PLUGINS_MODULE_NAME'
        )
    FORM_HANDLER_PLUGINS_MODULE_NAME = get_setting(
        'FORM_HANDLER_PLUGINS_MODULE_NAME'
        )
    THEMES_MODULE_NAME = get_setting(
        'THEMES_MODULE_NAME'
        )
    FORM_CALLBACKS_MODULE_NAME = get_setting(
        'FORM_CALLBACKS_MODULE_NAME'
        )

    FORM_IMPORTER_PLUGINS_MODULE_NAME = get_setting(
        'FORM_IMPORTER_PLUGINS_MODULE_NAME'
        )

    # Discover modules
    autodiscover_modules(FORM_ELEMENT_PLUGINS_MODULE_NAME)
    autodiscover_modules(FORM_HANDLER_PLUGINS_MODULE_NAME)
    autodiscover_modules(THEMES_MODULE_NAME)
    autodiscover_modules(FORM_CALLBACKS_MODULE_NAME)

    # Do not yet discover form importers
    autodiscover_modules(FORM_IMPORTER_PLUGINS_MODULE_NAME)

    if six.PY3 and recursion_limit > default_recursion_limit:
        sys.setrecursionlimit(default_recursion_limit)
Exemplo n.º 4
0
    "FAIL_ON_MISSING_FORM_HANDLER_PLUGINS",
    "FAIL_ON_ERRORS_IN_FORM_ELEMENT_PLUGINS",
    "FAIL_ON_ERRORS_IN_FORM_HANDLER_PLUGINS",
    "WAIT_BETWEEN_TEST_STEPS",
    "WAIT_AT_TEST_END",
)

from fobi.conf import get_setting
from fobi.exceptions import NoDefaultThemeSet

# **************************************************************
# **************************************************************
# *************************** Core *****************************
# **************************************************************
# **************************************************************
RESTRICT_PLUGIN_ACCESS = get_setting("RESTRICT_PLUGIN_ACCESS")

FORM_ELEMENT_PLUGINS_MODULE_NAME = get_setting("FORM_ELEMENT_PLUGINS_MODULE_NAME")

FORM_HANDLER_PLUGINS_MODULE_NAME = get_setting("FORM_HANDLER_PLUGINS_MODULE_NAME")

FORM_IMPORTER_PLUGINS_MODULE_NAME = get_setting("FORM_IMPORTER_PLUGINS_MODULE_NAME")

FORM_CALLBACKS_MODULE_NAME = get_setting("FORM_CALLBACKS_MODULE_NAME")

THEMES_MODULE_NAME = get_setting("THEMES_MODULE_NAME")

DEFAULT_THEME = get_setting("DEFAULT_THEME")

DISPLAY_AUTH_LINK = get_setting("DISPLAY_AUTH_LINK")
Exemplo n.º 5
0
    'FAIL_ON_MISSING_FORM_HANDLER_PLUGINS',
    'FAIL_ON_ERRORS_IN_FORM_ELEMENT_PLUGINS',
    'FAIL_ON_ERRORS_IN_FORM_HANDLER_PLUGINS',
    'WAIT_BETWEEN_TEST_STEPS',
    'WAIT_AT_TEST_END',
)

from fobi.conf import get_setting
from fobi.exceptions import NoDefaultThemeSet

# **************************************************************
# **************************************************************
# *************************** Core *****************************
# **************************************************************
# **************************************************************
RESTRICT_PLUGIN_ACCESS = get_setting('RESTRICT_PLUGIN_ACCESS')

FORM_ELEMENT_PLUGINS_MODULE_NAME = \
    get_setting('FORM_ELEMENT_PLUGINS_MODULE_NAME')

FORM_HANDLER_PLUGINS_MODULE_NAME = \
    get_setting('FORM_HANDLER_PLUGINS_MODULE_NAME')

FORM_IMPORTER_PLUGINS_MODULE_NAME = \
    get_setting('FORM_IMPORTER_PLUGINS_MODULE_NAME')

FORM_CALLBACKS_MODULE_NAME = get_setting('FORM_CALLBACKS_MODULE_NAME')

THEMES_MODULE_NAME = get_setting('THEMES_MODULE_NAME')

DEFAULT_THEME = get_setting('DEFAULT_THEME')