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
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)
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', )
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):
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',)