Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)