How to use the iredis.renders function in iredis

To help you get started, we’ve selected a few iredis examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github laixintao / iredis / tests / test_render_functions.py View on Github external
def test_list_or_string():
    config.raw = False
    assert renders.render_string_or_int(b"10.1") == '"10.1"'
    assert renders.render_string_or_int(3) == FormattedText(
        [("class:type", "(integer) "), ("", "3")]
    )
github laixintao / iredis / iredis / client.py View on Github external
def reder_funcname_mapping(self):
        mapping = {}
        for func_name, func in renders.__dict__.items():
            if callable(func):
                mapping[func_name] = func
        return mapping
github laixintao / iredis / iredis / client.py View on Github external
def render_response(self, response, completer, command_name, **options):
        "Parses a response from the Redis server"
        logger.info(f"[Redis-Server] Response: {response}")
        # if in transaction, use queue render first
        if config.transaction:
            callback = renders.render_transaction_queue
            rendered = callback(response, completer)
        else:
            rendered = self.render_command_result(command_name, response, completer)
        return rendered