コード例 #1
0
ファイル: __init__.py プロジェクト: igorgue/osqa
class ConsumerAndContext:
    def __init__(self, id, consumer, context):
        self.id = id
        self._consumer = consumer

        context.id = id
        self.context = context

    @property
    def consumer(self):
        return self._consumer()

consumers = dict([
            (re.sub('AuthConsumer$', '', name).lower(), cls) for name, cls
            in get_modules_script_classes('authentication', AuthenticationConsumer).items()
            if not re.search('AbstractAuthConsumer$', name)
        ])

contexts = dict([
            (re.sub('AuthContext$', '', name).lower(), cls) for name, cls
            in get_modules_script_classes('authentication', ConsumerTemplateContext).items()
        ])

AUTH_PROVIDERS = dict([
            (name, ConsumerAndContext(name, consumers[name], contexts[name])) for name in consumers.keys()
            if name in contexts
        ])


#todo: probably this don't belong here, also this post_stored routine needs a lot of work
コード例 #2
0
ファイル: __init__.py プロジェクト: diaakasem/osqa
    def __init__(self, id, consumer, context):
        self.id = id
        self._consumer = consumer

        context.id = id
        self.context = context

    @property
    def consumer(self):
        return self._consumer()


consumers = dict(
    [
        (re.sub("AuthConsumer$", "", name).lower(), cls)
        for name, cls in get_modules_script_classes("authentication", AuthenticationConsumer).items()
        if not re.search("AbstractAuthConsumer$", name)
    ]
)

contexts = dict(
    [
        (re.sub("AuthContext$", "", name).lower(), cls)
        for name, cls in get_modules_script_classes("authentication", ConsumerTemplateContext).items()
    ]
)

AUTH_PROVIDERS = dict(
    [(name, ConsumerAndContext(name, consumers[name], contexts[name])) for name in consumers.keys() if name in contexts]
)
コード例 #3
0
ファイル: __init__.py プロジェクト: pekka/askbot-devel
        'Answer',
        'AnswerRevision',
        'AnonymousAnswer',

        'Tag',
        'Comment',
        'Vote',
        'FlaggedItem',
        'MarkedTag',

        'Badge',
        'Award',
        'Repute',

        'Activity',
        'EmailFeedSetting',
        'ValidationHash',
        'AuthKeyUserAssociation',

        'User',
        ]


from forum.modules import get_modules_script_classes

for k, v in get_modules_script_classes('models', models.Model).items():
    if not k in __all__:
        __all__.append(k)
        exec "%s = v" % k
コード例 #4
0
    'AnonymousNode',
    'Question',
    'FavoriteQuestion',
    'QuestionSubscription',
    'QuestionRevision',
    'Answer',
    'AnswerRevision',
    'Tag',
    'Comment',
    'Vote',
    'FlaggedItem',
    'MarkedTag',
    'Badge',
    'Award',
    'Repute',
    'Activity',
    'ValidationHash',
    'AuthKeyUserAssociation',
    'SubscriptionSettings',
    'KeyValue',
    'User',
]

from forum.modules import get_modules_script_classes

for k, v in get_modules_script_classes('models', models.Model).items():
    if not k in __all__:
        __all__.append(k)
        exec "%s = v" % k

NodeMetaClass.setup_relations()
コード例 #5
0
ファイル: __init__.py プロジェクト: trollderius/estafa2
class ConsumerAndContext:
    def __init__(self, id, consumer, context):
        self.id = id
        self._consumer = consumer

        context.id = id
        self.context = context

    @property
    def consumer(self):
        return self._consumer()


consumers = dict([(re.sub('AuthConsumer$', '', name).lower(), cls)
                  for name, cls in get_modules_script_classes(
                      'authentication', AuthenticationConsumer).items()
                  if not re.search('AbstractAuthConsumer$', name)])

contexts = dict([(re.sub('AuthContext$', '', name).lower(), cls)
                 for name, cls in get_modules_script_classes(
                     'authentication', ConsumerTemplateContext).items()])

AUTH_PROVIDERS = dict([(name,
                        ConsumerAndContext(name, consumers[name],
                                           contexts[name]))
                       for name in consumers.keys() if name in contexts])

#todo: probably this don't belong here, also this post_stored routine needs a lot of work
user_logged_in = django.dispatch.Signal(providing_args=["user", "old_session"])
user_updated = django.dispatch.Signal(
    providing_args=["instance", "updated_by"])
コード例 #6
0
ファイル: __init__.py プロジェクト: interstar/osqa
import re

from forum.badges.base import AbstractBadge
from forum.modules import get_modules_script_classes

ALL_BADGES = [
            cls() for name, cls
            in get_modules_script_classes('badges', AbstractBadge).items()
            if not re.search('AbstractBadge$', name)
        ]
コード例 #7
0
ファイル: __init__.py プロジェクト: EzerchE/askbot-devel
import re

from forum.badges.base import BadgeImplementation
from forum.modules import get_modules_script_classes

ALL_BADGES = dict([
            (re.sub('BadgeImpl', '', name).lower(), cls) for name, cls
            in get_modules_script_classes('badges', BadgeImplementation).items()
            if not re.search('AbstractBadgeImpl$', name)
        ])
コード例 #8
0
import re

from forum.badges.base import AbstractBadge
from forum.modules import get_modules_script_classes

ALL_BADGES = [
    cls() for name, cls in get_modules_script_classes('badges',
                                                      AbstractBadge).items()
    if not re.search('AbstractBadge$', name)
]