示例#1
0
def test_named_blinker():
    sig = blinker.NamedSignal('squiznart')
    assert 'squiznart' in repr(sig)
示例#2
0
import typing

import bson
import blinker
import bson

from flask import Blueprint, current_app, request
from werkzeug import exceptions as wz_exceptions

from pillar.api import local_auth
from pillar.api.utils import mongo
from pillar.api.utils import authorization, authentication, str2id, jsonify

blueprint = Blueprint('service', __name__)
log = logging.getLogger(__name__)
signal_user_changed_role = blinker.NamedSignal('badger:user_changed_role')

ROLES_WITH_GROUPS = {'admin', 'demo', 'subscriber'}

# Map of role name to group ID, for the above groups.
role_to_group_id = {}


class ServiceAccountCreationError(Exception):
    """Raised when a service account cannot be created."""


@blueprint.before_app_first_request
def fetch_role_to_group_id_map():
    """Fills the _role_to_group_id mapping upon application startup."""
示例#3
0
 def __init__(self):
     self._bus = blinker.NamedSignal("tomate")
示例#4
0
文件: event.py 项目: skalanux/focusyn
 def __init__(self):
     self._bus = blinker.NamedSignal("focusyn")