def test_named_blinker(): sig = blinker.NamedSignal('squiznart') assert 'squiznart' in repr(sig)
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."""
def __init__(self): self._bus = blinker.NamedSignal("tomate")
def __init__(self): self._bus = blinker.NamedSignal("focusyn")