예제 #1
0
 def sections(self):
     sec = {}
     unsupported = []
     sections = OrderedDict()
     for info in COMMANDS_INFO.values():
         if info.group not in sections:
             sections[info.group] = []
         group = sections[info.group]
         if info.supported:
             group.append(info)
         else:
             unsupported.append(info)
     return unsupported, sections
예제 #2
0
 def sections(self):
     sec = {}
     unsupported = []
     sections = OrderedDict()
     for info in COMMANDS_INFO.values():
         if info.group not in sections:
             sections[info.group] = []
         group = sections[info.group]
         if info.supported:
             group.append(info)
         else:
             unsupported.append(info)
     return unsupported, sections
예제 #3
0
import pulsar
from pulsar.utils.structures import mapping_iterator, Zset
from pulsar.utils.pep import native_str, zip, ispy3k, iteritems
from pulsar.apps.ds import COMMANDS_INFO

from .pubsub import PubSub


if ispy3k:
    str_or_bytes = (bytes, str)
else:   # pragma    nocover
    str_or_bytes = basestring

INVERSE_COMMANDS_INFO = dict(((i.method_name, i.name)
                              for i in COMMANDS_INFO.values()))


class CommandError(pulsar.PulsarException):
    pass


class Executor:
    __slots__ = ('client', 'command')

    def __init__(self, client, command):
        self.client = client
        self.command = command

    def __call__(self, *args, **options):
        return self.client.execute(self.command, *args, **options)
예제 #4
0
파일: client.py 프로젝트: wilddom/pulsar
from itertools import chain
import datetime

import pulsar
from pulsar.utils.pep import to_string
from pulsar.utils.structures import mapping_iterator, Zset
from pulsar.apps.ds import COMMANDS_INFO, CommandError

from .pubsub import RedisPubSub
from .lock import Lock

str_or_bytes = (bytes, str)

INVERSE_COMMANDS_INFO = dict(
    ((i.method_name, i.name) for i in COMMANDS_INFO.values()))


class Executor:
    __slots__ = ('client', 'command')

    def __init__(self, client, command):
        self.client = client
        self.command = command

    def __call__(self, *args, **options):
        return self.client.execute(self.command, *args, **options)


class ResponseError:
    __slots__ = ('exception', )
예제 #5
0
파일: client.py 프로젝트: quantmind/pulsar
from itertools import chain
import datetime

import pulsar
from pulsar.utils.pep import to_string
from pulsar.utils.structures import mapping_iterator, Zset
from pulsar.apps.ds import COMMANDS_INFO, CommandError

from .pubsub import RedisPubSub
from .lock import Lock

str_or_bytes = (bytes, str)

INVERSE_COMMANDS_INFO = dict(((i.method_name, i.name) for i in COMMANDS_INFO.values()))


class Executor:
    __slots__ = ("client", "command")

    def __init__(self, client, command):
        self.client = client
        self.command = command

    def __call__(self, *args, **options):
        return self.client.execute(self.command, *args, **options)


class ResponseError:
    __slots__ = ("exception",)

    def __init__(self, exception):
예제 #6
0
파일: client.py 프로젝트: shenxiusi/pulsar
from itertools import chain
import datetime

import pulsar
from pulsar.utils.pep import to_string
from pulsar.utils.structures import mapping_iterator, Zset
from pulsar.apps.ds import COMMANDS_INFO, CommandError

from .pubsub import RedisPubSub
from .lock import Lock

str_or_bytes = (bytes, str)

INVERSE_COMMANDS_INFO = dict(((i.method_name, i.name)
                              for i in COMMANDS_INFO.values()))


class Executor:
    __slots__ = ('client', 'command')

    def __init__(self, client, command):
        self.client = client
        self.command = command

    def __call__(self, *args, **options):
        return self.client.execute(self.command, *args, **options)


class ResponseError:
    __slots__ = ('exception',)