Exemplo n.º 1
0
"""OAuth initialization.

This module loads the WebAPI scopes when Review Board initializes.
"""

from __future__ import unicode_literals

from djblets.webapi.oauth2_scopes import enable_web_api_scopes
from reviewboard.signals import initializing


default_app_config = 'reviewboard.oauth.apps.OAuthAppConfig'


initializing.connect(enable_web_api_scopes)
Exemplo n.º 2
0
from reviewboard.signals import initializing


def _register_review_uis(**kwargs):
    """Registers all bundled review UIs."""
    from reviewboard.reviews.ui.base import register_ui
    from reviewboard.reviews.ui.image import ImageReviewUI
    from reviewboard.reviews.ui.markdownui import MarkdownReviewUI


    register_ui(ImageReviewUI)
    register_ui(MarkdownReviewUI)


initializing.connect(_register_review_uis)
Exemplo n.º 3
0
from reviewboard.signals import initializing


def _register_review_uis(**kwargs):
    """Registers all bundled review UIs."""
    from reviewboard.reviews.ui.base import register_ui
    from reviewboard.reviews.ui.image import ImageReviewUI

    register_ui(ImageReviewUI)


initializing.connect(_register_review_uis)
Exemplo n.º 4
0
from __future__ import unicode_literals

from reviewboard.signals import initializing


def connect_signals(**kwargs):
    """
    Listens to the ``initializing`` signal and tells other modules to
    connect their signals. This is done so as to guarantee that django
    is loaded first.
    """
    from reviewboard.notifications import email, webhooks

    email.connect_signals()
    webhooks.connect_signals()


initializing.connect(connect_signals)
Exemplo n.º 5
0
from __future__ import unicode_literals

from reviewboard.signals import initializing


def _register_mimetype_handlers(**kwargs):
    """Registers all bundled Mimetype Handlers."""
    from reviewboard.attachments.mimetypes import (
        ImageMimetype,
        MarkDownMimetype,
        MimetypeHandler,
        register_mimetype_handler,
        ReStructuredTextMimetype,
        TextMimetype,
    )

    register_mimetype_handler(ImageMimetype)
    register_mimetype_handler(MarkDownMimetype)
    register_mimetype_handler(MimetypeHandler)
    register_mimetype_handler(ReStructuredTextMimetype)
    register_mimetype_handler(TextMimetype)


initializing.connect(_register_mimetype_handlers)
Exemplo n.º 6
0
from __future__ import unicode_literals

from reviewboard.signals import initializing


def _register_mimetype_handlers(**kwargs):
    """Registers all bundled Mimetype Handlers."""
    from reviewboard.attachments.mimetypes import (
        ImageMimetype, MarkDownMimetype, MimetypeHandler,
        register_mimetype_handler, ReStructuredTextMimetype, TextMimetype)

    register_mimetype_handler(ImageMimetype)
    register_mimetype_handler(MarkDownMimetype)
    register_mimetype_handler(MimetypeHandler)
    register_mimetype_handler(ReStructuredTextMimetype)
    register_mimetype_handler(TextMimetype)


initializing.connect(_register_mimetype_handlers)
Exemplo n.º 7
0
"""Local Site-specfic initialization."""

from reviewboard.signals import initializing


def _on_initializing(**kwargs):
    """Set up signal handlers for Local Sites."""
    from django.db.models.signals import m2m_changed

    from reviewboard.site.models import LocalSite
    from reviewboard.site.signal_handlers import on_users_changed

    m2m_changed.connect(on_users_changed, sender=LocalSite.users.through)


initializing.connect(_on_initializing)
Exemplo n.º 8
0
"""OAuth initialization.

This module loads the WebAPI scopes when Review Board initializes.
"""

from __future__ import unicode_literals

from djblets.webapi.oauth2_scopes import enable_web_api_scopes
from reviewboard.signals import initializing

default_app_config = 'reviewboard.oauth.apps.OAuthAppConfig'

initializing.connect(enable_web_api_scopes)