Exemplo n.º 1
0
def plugin_load_wsgi():
    from pytsite import lang, router
    from plugins import settings, auth_ui, auth_google
    from . import _driver, _eh, _settings_form, _controllers

    # Language globals
    lang.register_global(
        'auth_ui_google_admin_settings_url',
        lambda language, args: settings.form_url('auth_google'))

    # Event handlers
    router.on_dispatch(_eh.router_dispatch)

    # Settings
    settings.define('auth_google', _settings_form.Form,
                    'auth_ui_google@auth_google', 'fa fa-google', 'dev')

    try:
        auth_ui.register_driver(_driver.UI(auth_google.get_client_id()))
        router.handle(_controllers.Authorization,
                      '/auth_google/authorization',
                      'auth_ui_google@authorization',
                      filters=auth_ui.AuthFilter)

    except auth_google.error.ClientIdNotDefined:
        pass
Exemplo n.º 2
0
def plugin_load_wsgi():
    from pytsite import lang, router
    from plugins import settings
    from . import _eh, _settings_form

    # Resources
    lang.register_global(
        'google_maps_admin_settings_url',
        lambda language, args: settings.form_url('google_maps'))

    # Settings
    settings.define('google_maps', _settings_form.Form,
                    'google_maps_ui@google_maps', 'fa fa-map', 'dev')

    # Event handlers
    router.on_dispatch(_eh.on_router_dispatch)
Exemplo n.º 3
0
def plugin_load_uwsgi():
    from pytsite import lang, router
    from plugins import settings
    from . import _settings_form, _eh

    # Resources
    lang.register_package(__name__)

    # Lang globals
    lang.register_global('tumblr_admin_settings_url', lambda language, args: settings.form_url('tumblr'))

    # Settings
    settings.define('tumblr', _settings_form.Form, 'tumblr@tumblr', 'fa fa-tumblr', 'dev')

    # Event handlers
    router.on_dispatch(_eh.router_dispatch)
Exemplo n.º 4
0
def plugin_load_uwsgi():
    from pytsite import lang, router
    from plugins import settings
    from . import _eh, _settings_form, _controllers

    # Lang globals
    lang.register_global('facebook_admin_settings_url', lambda language, args: settings.form_url('facebook'))

    # Routes
    router.handle(_controllers.Authorize, '/facebook/authorize', 'facebook@authorize')

    # Settings
    settings.define('facebook', _settings_form.Form, 'facebook@facebook', 'fa fa-facebook', 'dev')

    # Event handlers
    router.on_dispatch(_eh.router_dispatch)
Exemplo n.º 5
0
def plugin_load_wsgi():
    from pytsite import lang, router
    from plugins import settings
    from . import _settings_form, _eh

    # Lang globals
    lang.register_global(
        'google_analytics_admin_settings_url',
        lambda language, args: settings.form_url('google_analytics'))

    # Settings
    settings.define('google_analytics', _settings_form.Form,
                    'google_analytics@google_analytics', 'fa fa-line-chart',
                    'dev')

    # Event handlers
    router.on_dispatch(_eh.router_dispatch)
Exemplo n.º 6
0
def plugin_load_wsgi():
    """Hook
    """
    from pytsite import lang, router
    from plugins import settings
    from . import _settings_form, _eh

    # Lang globals
    lang.register_global('addthis_admin_settings_url',
                         lambda language, args: settings.form_url('addthis'))

    # Settings
    settings.define('addthis', _settings_form.Form, 'addthis@addthis',
                    'fa fas fa-plus-square', 'dev')

    # Events
    router.on_dispatch(_eh.router_dispatch)
Exemplo n.º 7
0
def plugin_load_wsgi():
    from pytsite import lang, router
    from plugins import comments, settings
    from . import _eh, _comments, _settings_form

    # Lang globals
    lang.register_global('disqus_admin_settings_url',
                         lambda language, args: settings.form_url('disqus'))

    # Comments driver
    comments.register_driver(_comments.Driver())

    # Settings
    settings.define('disqus', _settings_form.Form, 'disqus@disqus',
                    'fa fa-comments', 'dev')

    # Event handlers
    router.on_dispatch(_eh.router_dispatch)