1
0
Fork 0

Adding upstream version 1.11.0.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-09 17:06:02 +01:00
parent e47dfcc74f
commit 10fd6b3697
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
21 changed files with 128 additions and 118 deletions

View file

@ -1,5 +1,5 @@
[bumpversion] [bumpversion]
current_version = 1.10.0 current_version = 1.11.0
commit = True commit = True
tag = True tag = True

View file

@ -56,6 +56,10 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: codespell-project/actions-codespell@master
with:
ignore_words_list: fo,ists,oll,optin,ot,smove,tre,whe
exclude_file: docs/assets/demo.svg
- uses: actions/setup-python@v1 - uses: actions/setup-python@v1
with: with:
python-version: 3.7 python-version: 3.7

View file

@ -1,3 +1,8 @@
## 1.11
- Dependency: Upgrade mistune lib to ^2.0. (see
https://github.com/laixintao/iredis/issues/232)
## 1.10 ## 1.10
- Feature: more human readable output for `HELP` command like `ACL HELP` and - Feature: more human readable output for `HELP` command like `ACL HELP` and

View file

@ -1 +1 @@
__version__ = "1.10.0" __version__ = "1.11.0"

View file

@ -224,7 +224,7 @@ class Client:
logger.info( logger.info(
f"execute by connection: connection={connection}, name={command_name}, {args}, {options}" f"execute by connection: connection={connection}, name={command_name}, {args}, {options}"
) )
retry_times = config.retry_times # FIXME configureable retry_times = config.retry_times # FIXME configurable
last_error = None last_error = None
need_refresh_connection = False need_refresh_connection = False
@ -487,7 +487,7 @@ class Client:
""" """
if command_name.upper() == "HELLO": if command_name.upper() == "HELLO":
raise NotSupport("IRedis currently not support RESP3, sorry about that.") raise NotSupport("IRedis currently not support RESP3, sorry about that.")
# TRANSATION state chage # TRANSACTION state change
if command_name.upper() in ["EXEC", "DISCARD"]: if command_name.upper() in ["EXEC", "DISCARD"]:
logger.debug(f"[After hook] Command is {command_name}, unset transaction.") logger.debug(f"[After hook] Command is {command_name}, unset transaction.")
config.transaction = False config.transaction = False
@ -527,25 +527,25 @@ class Client:
rendered_detail = markdown.render(doc) rendered_detail = markdown.render(doc)
summary_dict = commands_summary[command_summary_name] summary_dict = commands_summary[command_summary_name]
avaiable_version = summary_dict.get("since", "?") available_version = summary_dict.get("since", "?")
server_version = config.version server_version = config.version
# FIXME anything strange with single quotes? # FIXME anything strange with single quotes?
logger.debug(f"[--version--] '{server_version}'") logger.debug(f"[--version--] '{server_version}'")
try: try:
is_avaiable = StrictVersion(server_version) > StrictVersion( is_available = StrictVersion(server_version) > StrictVersion(
avaiable_version available_version
) )
except Exception as e: except Exception as e:
logger.exception(e) logger.exception(e)
is_avaiable = None is_available = None
if is_avaiable: if is_available:
avaiable_text = f"(Avaiable on your redis-server: {server_version})" available_text = f"(Available on your redis-server: {server_version})"
elif is_avaiable is False: elif is_available is False:
avaiable_text = f"(Not avaiable on your redis-server: {server_version})" available_text = f"(Not available on your redis-server: {server_version})"
else: else:
avaiable_text = "" available_text = ""
since_text = f"{avaiable_version} {avaiable_text}" since_text = f"{available_version} {available_text}"
summary = [ summary = [
("", "\n"), ("", "\n"),

View file

@ -20,7 +20,7 @@ def _load_command_summary():
def _load_command(): def _load_command():
""" """
load command informations from file. load command information from file.
:returns: :returns:
- original_commans: dict, command name : Command - original_commans: dict, command name : Command
- command_group: dict, group_name: command_names - command_group: dict, group_name: command_names
@ -115,7 +115,7 @@ def split_command_args(command):
command = command.strip() command = command.strip()
for command_name in all_commands: for command_name in all_commands:
# for command that is paritaly inputed, like `command in`, we should # for command that is paritaly input, like `command in`, we should
# match with `command info`, otherwise, `command in` will result in # match with `command info`, otherwise, `command in` will result in
# `command` with `args` is ('in') which is an invalid case. # `command` with `args` is ('in') which is an invalid case.
normalized_input_command = " ".join(command.split()).upper() normalized_input_command = " ".join(command.split()).upper()
@ -125,7 +125,7 @@ def split_command_args(command):
and command_name != normalized_input_command and command_name != normalized_input_command
): ):
raise AmbiguousCommand("command is not finished") raise AmbiguousCommand("command is not finished")
# allow multiplt space in user inputed command # allow multiple space in user input command
command_allow_multi_spaces = "[ ]+".join(command_name.split()) command_allow_multi_spaces = "[ ]+".join(command_name.split())
matcher = re.match(fr"({command_allow_multi_spaces})( |$)", command.upper()) matcher = re.match(fr"({command_allow_multi_spaces})( |$)", command.upper())
if matcher: if matcher:

View file

@ -94,8 +94,8 @@ class TimestampCompleter(Completer):
return return
current = int(text) current = int(text)
now = pendulum.now() now = pendulum.now()
for unit, minium in self.when_lower_than.items(): for unit, minimum in self.when_lower_than.items():
if current <= minium: if current <= minimum:
dt = now.subtract(**{f"{unit}s": current}) dt = now.subtract(**{f"{unit}s": current})
meta = f"{text} {unit}{'s' if current > 1 else ''} ago ({dt.format('YYYY-MM-DD HH:mm:ss')})" meta = f"{text} {unit}{'s' if current > 1 else ''} ago ({dt.format('YYYY-MM-DD HH:mm:ss')})"
yield Completion( yield Completion(
@ -205,7 +205,7 @@ class IRedisCompleter(Completer):
for _token_in_command in tokens_in_command: for _token_in_command in tokens_in_command:
# prompt_toolkit didn't support multi tokens # prompt_toolkit didn't support multi tokens
# like DEL key1 key2 key3 # like DEL key1 key2 key3
# so we have to split them manualy # so we have to split them manually
for single_token in strip_quote_args(_token_in_command): for single_token in strip_quote_args(_token_in_command):
_completer.touch(single_token) _completer.touch(single_token)
@ -310,7 +310,7 @@ class IRedisCompleter(Completer):
"member": member_completer, "member": member_completer,
"members": member_completer, "members": member_completer,
# zmember # zmember
# TODO sperate sorted set and set # TODO separate sorted set and set
# hash fields # hash fields
"field": field_completer, "field": field_completer,
"fields": field_completer, "fields": field_completer,

View file

@ -5048,7 +5048,7 @@
}, },
"XADD": { "XADD": {
"summary": "Appends a new entry to a stream", "summary": "Appends a new entry to a stream",
"complexity": "O(1) when adding a new entry, O(N) when trimming where N being the number of entires evicted.", "complexity": "O(1) when adding a new entry, O(N) when trimming where N being the number of entries evicted.",
"arguments": [ "arguments": [
{ {
"name": "key", "name": "key",

View file

@ -733,7 +733,7 @@ Valid formats:
> - big endian > - big endian
< - little endian < - little endian
![num] - alignment ![num] - alignment
x - pading x - padding
b/B - signed/unsigned byte b/B - signed/unsigned byte
h/H - signed/unsigned short h/H - signed/unsigned short
l/L - signed/unsigned long l/L - signed/unsigned long

View file

@ -52,7 +52,7 @@ to match the one of this other system.
documentation page for more information. This allows adding new entries and documentation page for more information. This allows adding new entries and
keeping the stream's size in check with a single call to `XADD`, effectively keeping the stream's size in check with a single call to `XADD`, effectively
capping the stream with an arbitrary threshold. Although exact trimming is capping the stream with an arbitrary threshold. Although exact trimming is
possible and is the default, due to the internal representation of steams it is possible and is the default, due to the internal representation of streams it is
more efficient to add an entry and trim stream with `XADD` using **almost more efficient to add an entry and trim stream with `XADD` using **almost
exact** trimming (the `~` argument). exact** trimming (the `~` argument).

View file

@ -32,7 +32,7 @@ shell = True
# decode redis response, default None # decode redis response, default None
decode = decode =
# enable pager? defualt to True, you can disable it by changing it to False # enable pager? default to True, you can disable it by changing it to False
enable_pager = True enable_pager = True
# pager setting when line is too tall # pager setting when line is too tall
@ -52,7 +52,7 @@ bottom_bar = True
warning = True warning = True
# IRedis log for debugging, leave this blank will disable log. # IRedis log for debugging, leave this blank will disable log.
# You don't need this unless you are debuging iredis. # You don't need this unless you are debugging iredis.
# Be careful this will log your commands input (include AUTH with password) to # Be careful this will log your commands input (include AUTH with password) to
# log file. # log file.
# eg. ~/.iredis.log # eg. ~/.iredis.log

View file

@ -160,7 +160,7 @@ class Rainbow:
def prompt_message(client): def prompt_message(client):
# TODO custome prompt # TODO custom prompt
text = "{hostname}> ".format(hostname=str(client)) text = "{hostname}> ".format(hostname=str(client))
if config.rainbow: if config.rainbow:
return list(zip(Rainbow(), text)) return list(zip(Rainbow(), text))

View file

@ -13,24 +13,24 @@ from prompt_toolkit.formatted_text import to_formatted_text, HTML
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
class TerminalRender(mistune.Renderer): class TerminalRender(mistune.HTMLRenderer):
def _to_title(self, text): def _to_title(self, text):
return f"{text}\n{'='*len(text)}\n" return f"{text}\n{'='*len(text)}\n"
def paragraph(self, text): def paragraph(self, text):
return text + "\n\n" return text + "\n\n"
def block_code(self, code, language=None): def block_code(self, code, info=None):
code = "\n".join([" " + line for line in code.splitlines()]) code = "\n".join([" " + line for line in code.splitlines()])
return super().block_code(code) return super().block_code(code)
def header(self, text, level, raw=None): def heading(self, text, level):
if level == 2: if level == 2:
header_text = self._to_title(text) header_text = self._to_title(text)
return super().header(header_text, 2) return super().heading(header_text, 2)
return super().header(self._to_title(text), level) return super().heading(self._to_title(text), level)
def list(self, body, ordered=True): def list(self, body, ordered, level, start=None):
"""Rendering list tags like ``<ul>`` and ``<ol>``. """Rendering list tags like ``<ul>`` and ``<ol>``.
:param body: body contents of the list. :param body: body contents of the list.
@ -41,29 +41,26 @@ class TerminalRender(mistune.Renderer):
tag = "ol" tag = "ol"
return "<%s>%s</%s>\n" % (tag, body, tag) return "<%s>%s</%s>\n" % (tag, body, tag)
def list_item(self, text): def list_item(self, text, level):
"""Rendering list item snippet. Like ``<li>``.""" """Rendering list item snippet. Like ``<li>``."""
return "<li> * %s</li>\n" % text return "<li> * %s</li>\n" % text
class RedisDocLexer(mistune.BlockLexer):
def enable_at_title(self):
self.rules.at_title = re.compile(r"^@(\w+) *(?:\n+|$)") # @example
self.default_rules.insert(0, "at_title")
def parse_at_title(self, m):
text = m.group(1)
self.tokens.append({"type": "heading", "level": 2, "text": text})
renderer = TerminalRender() renderer = TerminalRender()
block_lexer = RedisDocLexer() markdown_render = mistune.Markdown(renderer)
block_lexer.enable_at_title()
markdown_render = mistune.Markdown(renderer, block=block_lexer) # replace redis doc's title (and following newlines & spaces)
# with markdown's second level title
redisdoc_title_re = re.compile(r"^@(\w+) *(?:\n+|$)")
def replace_to_markdown_title(original):
replaced = redisdoc_title_re.sub(r"## \g<1>", original)
return replaced
def render(text): def render(text):
html_text = markdown_render(text) replaced = replace_to_markdown_title(text)
html_text = markdown_render(replaced)
logger.debug("[Document] {} ...".format(html_text)[:20]) logger.debug("[Document] {} ...".format(html_text)[:20])
return to_formatted_text(HTML(html_text)) return to_formatted_text(HTML(html_text))

View file

@ -622,7 +622,7 @@ def get_command_grammar(command):
syntax = GRAMMAR.get(syntax_name) syntax = GRAMMAR.get(syntax_name)
# If a command is not supported yet, (e.g. command from latest version added # If a command is not supported yet, (e.g. command from latest version added
# by Redis recently, or command from third Redis module.) return a defualt # by Redis recently, or command from third Redis module.) return a default
# grammar, so the lexer and completion won't be activated. # grammar, so the lexer and completion won't be activated.
if syntax is None: if syntax is None:
return command_grammar return command_grammar

View file

@ -74,8 +74,8 @@ class OutputRender:
utf-8 decoded. utf-8 decoded.
""" """
decoded = nativestr(value) decoded = nativestr(value)
splitted = "\n".join(decoded.splitlines()) # get rid of last newline split = "\n".join(decoded.splitlines()) # get rid of last newline
return splitted return split
@staticmethod @staticmethod
def render_nested_pair(value): def render_nested_pair(value):
@ -163,7 +163,7 @@ class OutputRender:
def render_simple_string(text): def render_simple_string(text):
""" """
If response is b'OK', render simple string always with success color. If response is b'OK', render simple string always with success color.
If Error happend, error will be rendered by ``render_error`` If Error happens, error will be rendered by ``render_error``
""" """
if text is None: if text is None:
return NIL return NIL
@ -174,7 +174,7 @@ class OutputRender:
def render_help(raw): def render_help(raw):
""" """
render help text message. render help text message.
the comand like ``ACL HELP`` and ``MEMORY HELP`` the command like ``ACL HELP`` and ``MEMORY HELP``
will return a list of strings. will return a list of strings.
we render it as plain text we render it as plain text
""" """

View file

@ -39,9 +39,9 @@ GROUP = {
"group.server": "#E6DB74", "group.server": "#E6DB74",
"group.set": "#E6DB74", "group.set": "#E6DB74",
"group.sortedset": "#E6DB74", "group.sortedset": "#E6DB74",
"group.stram": "#E6DB74", "group.stream": "#E6DB74",
"group.string": "#E6DB74", "group.string": "#E6DB74",
"group.transections": "#E6DB74", "group.transactions": "#E6DB74",
} }

View file

@ -229,7 +229,7 @@ def ensure_str(origin, decode=None):
return origin.decode(decode) return origin.decode(decode)
return _literal_bytes(origin) return _literal_bytes(origin)
else: else:
raise Exception(f"Unkown type: {type(origin)}, origin: {origin}") raise Exception(f"Unknown type: {type(origin)}, origin: {origin}")
def double_quotes(unquoted): def double_quotes(unquoted):

108
poetry.lock generated
View file

@ -8,17 +8,17 @@ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
[[package]] [[package]]
name = "attrs" name = "attrs"
version = "21.2.0" version = "21.4.0"
description = "Classes Without Boilerplate" description = "Classes Without Boilerplate"
category = "dev" category = "dev"
optional = false optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*"
[package.extras] [package.extras]
dev = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface", "furo", "sphinx", "sphinx-notfound-page", "pre-commit"] dev = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface", "furo", "sphinx", "sphinx-notfound-page", "pre-commit", "cloudpickle"]
docs = ["furo", "sphinx", "zope.interface", "sphinx-notfound-page"] docs = ["furo", "sphinx", "zope.interface", "sphinx-notfound-page"]
tests = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface"] tests = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface", "cloudpickle"]
tests_no_zope = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins"] tests_no_zope = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "cloudpickle"]
[[package]] [[package]]
name = "click" name = "click"
@ -49,7 +49,7 @@ six = "*"
[[package]] [[package]]
name = "importlib-metadata" name = "importlib-metadata"
version = "4.5.0" version = "4.8.3"
description = "Read metadata from Python packages" description = "Read metadata from Python packages"
category = "dev" category = "dev"
optional = false optional = false
@ -61,11 +61,12 @@ zipp = ">=0.5"
[package.extras] [package.extras]
docs = ["sphinx", "jaraco.packaging (>=8.2)", "rst.linker (>=1.9)"] docs = ["sphinx", "jaraco.packaging (>=8.2)", "rst.linker (>=1.9)"]
testing = ["pytest (>=4.6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-cov", "pytest-enabler (>=1.0.1)", "packaging", "pep517", "pyfakefs", "flufl.flake8", "pytest-black (>=0.3.7)", "pytest-mypy", "importlib-resources (>=1.3)"] perf = ["ipython"]
testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-cov", "pytest-enabler (>=1.0.1)", "packaging", "pep517", "pyfakefs", "flufl.flake8", "pytest-perf (>=0.9.2)", "pytest-black (>=0.3.7)", "pytest-mypy", "importlib-resources (>=1.3)"]
[[package]] [[package]]
name = "importlib-resources" name = "importlib-resources"
version = "5.1.4" version = "5.4.0"
description = "Read resources from Python packages" description = "Read resources from Python packages"
category = "main" category = "main"
optional = false optional = false
@ -76,7 +77,7 @@ zipp = {version = ">=3.1.0", markers = "python_version < \"3.10\""}
[package.extras] [package.extras]
docs = ["sphinx", "jaraco.packaging (>=8.2)", "rst.linker (>=1.9)"] docs = ["sphinx", "jaraco.packaging (>=8.2)", "rst.linker (>=1.9)"]
testing = ["pytest (>=4.6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-cov", "pytest-enabler (>=1.0.1)", "pytest-black (>=0.3.7)", "pytest-mypy"] testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-cov", "pytest-enabler (>=1.0.1)", "pytest-black (>=0.3.7)", "pytest-mypy"]
[[package]] [[package]]
name = "iniconfig" name = "iniconfig"
@ -88,22 +89,22 @@ python-versions = "*"
[[package]] [[package]]
name = "mistune" name = "mistune"
version = "0.8.4" version = "2.0.2"
description = "The fastest markdown parser in pure Python" description = "A sane Markdown parser with useful plugins and renderers"
category = "main" category = "main"
optional = false optional = false
python-versions = "*" python-versions = "*"
[[package]] [[package]]
name = "packaging" name = "packaging"
version = "20.9" version = "21.3"
description = "Core utilities for Python packages" description = "Core utilities for Python packages"
category = "dev" category = "dev"
optional = false optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" python-versions = ">=3.6"
[package.dependencies] [package.dependencies]
pyparsing = ">=2.0.2" pyparsing = ">=2.0.2,<3.0.5 || >3.0.5"
[[package]] [[package]]
name = "pendulum" name = "pendulum"
@ -130,17 +131,18 @@ ptyprocess = ">=0.5"
[[package]] [[package]]
name = "pluggy" name = "pluggy"
version = "0.13.1" version = "1.0.0"
description = "plugin and hook calling mechanisms for python" description = "plugin and hook calling mechanisms for python"
category = "dev" category = "dev"
optional = false optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" python-versions = ">=3.6"
[package.dependencies] [package.dependencies]
importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""}
[package.extras] [package.extras]
dev = ["pre-commit", "tox"] dev = ["pre-commit", "tox"]
testing = ["pytest", "pytest-benchmark"]
[[package]] [[package]]
name = "prompt-toolkit" name = "prompt-toolkit"
@ -163,15 +165,15 @@ python-versions = "*"
[[package]] [[package]]
name = "py" name = "py"
version = "1.10.0" version = "1.11.0"
description = "library with cross-python path, ini-parsing, io, code, log facilities" description = "library with cross-python path, ini-parsing, io, code, log facilities"
category = "dev" category = "dev"
optional = false optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*"
[[package]] [[package]]
name = "pygments" name = "pygments"
version = "2.9.0" version = "2.11.2"
description = "Pygments is a syntax highlighting package written in Python." description = "Pygments is a syntax highlighting package written in Python."
category = "main" category = "main"
optional = false optional = false
@ -179,11 +181,14 @@ python-versions = ">=3.5"
[[package]] [[package]]
name = "pyparsing" name = "pyparsing"
version = "2.4.7" version = "3.0.7"
description = "Python parsing module" description = "Python parsing module"
category = "dev" category = "dev"
optional = false optional = false
python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" python-versions = ">=3.6"
[package.extras]
diagrams = ["jinja2", "railroad-diagrams"]
[[package]] [[package]]
name = "pytest" name = "pytest"
@ -209,7 +214,7 @@ testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "requests", "xm
[[package]] [[package]]
name = "python-dateutil" name = "python-dateutil"
version = "2.8.1" version = "2.8.2"
description = "Extensions to the standard Python datetime module" description = "Extensions to the standard Python datetime module"
category = "main" category = "main"
optional = false optional = false
@ -255,11 +260,11 @@ python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*"
[[package]] [[package]]
name = "typing-extensions" name = "typing-extensions"
version = "3.10.0.0" version = "4.0.1"
description = "Backported and Experimental Type Hints for Python 3.5+" description = "Backported and Experimental Type Hints for Python 3.6+"
category = "dev" category = "dev"
optional = false optional = false
python-versions = "*" python-versions = ">=3.6"
[[package]] [[package]]
name = "wcwidth" name = "wcwidth"
@ -271,7 +276,7 @@ python-versions = "*"
[[package]] [[package]]
name = "zipp" name = "zipp"
version = "3.4.1" version = "3.6.0"
description = "Backport of pathlib-compatible object wrapper for zip files" description = "Backport of pathlib-compatible object wrapper for zip files"
category = "main" category = "main"
optional = false optional = false
@ -279,12 +284,12 @@ python-versions = ">=3.6"
[package.extras] [package.extras]
docs = ["sphinx", "jaraco.packaging (>=8.2)", "rst.linker (>=1.9)"] docs = ["sphinx", "jaraco.packaging (>=8.2)", "rst.linker (>=1.9)"]
testing = ["pytest (>=4.6)", "pytest-checkdocs (>=1.2.3)", "pytest-flake8", "pytest-cov", "pytest-enabler", "jaraco.itertools", "func-timeout", "pytest-black (>=0.3.7)", "pytest-mypy"] testing = ["pytest (>=4.6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-cov", "pytest-enabler (>=1.0.1)", "jaraco.itertools", "func-timeout", "pytest-black (>=0.3.7)", "pytest-mypy"]
[metadata] [metadata]
lock-version = "1.1" lock-version = "1.1"
python-versions = "^3.6" python-versions = "^3.6"
content-hash = "c1345a5bdc8b39df65ca2f5a85cbb935520bfb234b64c6ca5b2699e987e91a13" content-hash = "d391d026d55f4bc949fb0bd9703f8f5d57925752391afc1a9e1f378b31266b67"
[metadata.files] [metadata.files]
atomicwrites = [ atomicwrites = [
@ -292,8 +297,8 @@ atomicwrites = [
{file = "atomicwrites-1.4.0.tar.gz", hash = "sha256:ae70396ad1a434f9c7046fd2dd196fc04b12f9e91ffb859164193be8b6168a7a"}, {file = "atomicwrites-1.4.0.tar.gz", hash = "sha256:ae70396ad1a434f9c7046fd2dd196fc04b12f9e91ffb859164193be8b6168a7a"},
] ]
attrs = [ attrs = [
{file = "attrs-21.2.0-py2.py3-none-any.whl", hash = "sha256:149e90d6d8ac20db7a955ad60cf0e6881a3f20d37096140088356da6c716b0b1"}, {file = "attrs-21.4.0-py2.py3-none-any.whl", hash = "sha256:2d27e3784d7a565d36ab851fe94887c5eccd6a463168875832a1be79c82828b4"},
{file = "attrs-21.2.0.tar.gz", hash = "sha256:ef6aaac3ca6cd92904cdd0d83f629a15f18053ec84e6432106f7a4d04ae4f5fb"}, {file = "attrs-21.4.0.tar.gz", hash = "sha256:626ba8234211db98e869df76230a137c4c40a12d72445c45d5f5b716f076e2fd"},
] ]
click = [ click = [
{file = "click-7.1.2-py2.py3-none-any.whl", hash = "sha256:dacca89f4bfadd5de3d7489b7c8a566eee0d3676333fbb50030263894c38c0dc"}, {file = "click-7.1.2-py2.py3-none-any.whl", hash = "sha256:dacca89f4bfadd5de3d7489b7c8a566eee0d3676333fbb50030263894c38c0dc"},
@ -307,24 +312,24 @@ configobj = [
{file = "configobj-5.0.6.tar.gz", hash = "sha256:a2f5650770e1c87fb335af19a9b7eb73fc05ccf22144eb68db7d00cd2bcb0902"}, {file = "configobj-5.0.6.tar.gz", hash = "sha256:a2f5650770e1c87fb335af19a9b7eb73fc05ccf22144eb68db7d00cd2bcb0902"},
] ]
importlib-metadata = [ importlib-metadata = [
{file = "importlib_metadata-4.5.0-py3-none-any.whl", hash = "sha256:833b26fb89d5de469b24a390e9df088d4e52e4ba33b01dc5e0e4f41b81a16c00"}, {file = "importlib_metadata-4.8.3-py3-none-any.whl", hash = "sha256:65a9576a5b2d58ca44d133c42a241905cc45e34d2c06fd5ba2bafa221e5d7b5e"},
{file = "importlib_metadata-4.5.0.tar.gz", hash = "sha256:b142cc1dd1342f31ff04bb7d022492b09920cb64fed867cd3ea6f80fe3ebd139"}, {file = "importlib_metadata-4.8.3.tar.gz", hash = "sha256:766abffff765960fcc18003801f7044eb6755ffae4521c8e8ce8e83b9c9b0668"},
] ]
importlib-resources = [ importlib-resources = [
{file = "importlib_resources-5.1.4-py3-none-any.whl", hash = "sha256:e962bff7440364183203d179d7ae9ad90cb1f2b74dcb84300e88ecc42dca3351"}, {file = "importlib_resources-5.4.0-py3-none-any.whl", hash = "sha256:33a95faed5fc19b4bc16b29a6eeae248a3fe69dd55d4d229d2b480e23eeaad45"},
{file = "importlib_resources-5.1.4.tar.gz", hash = "sha256:54161657e8ffc76596c4ede7080ca68cb02962a2e074a2586b695a93a925d36e"}, {file = "importlib_resources-5.4.0.tar.gz", hash = "sha256:d756e2f85dd4de2ba89be0b21dba2a3bbec2e871a42a3a16719258a11f87506b"},
] ]
iniconfig = [ iniconfig = [
{file = "iniconfig-1.1.1-py2.py3-none-any.whl", hash = "sha256:011e24c64b7f47f6ebd835bb12a743f2fbe9a26d4cecaa7f53bc4f35ee9da8b3"}, {file = "iniconfig-1.1.1-py2.py3-none-any.whl", hash = "sha256:011e24c64b7f47f6ebd835bb12a743f2fbe9a26d4cecaa7f53bc4f35ee9da8b3"},
{file = "iniconfig-1.1.1.tar.gz", hash = "sha256:bc3af051d7d14b2ee5ef9969666def0cd1a000e121eaea580d4a313df4b37f32"}, {file = "iniconfig-1.1.1.tar.gz", hash = "sha256:bc3af051d7d14b2ee5ef9969666def0cd1a000e121eaea580d4a313df4b37f32"},
] ]
mistune = [ mistune = [
{file = "mistune-0.8.4-py2.py3-none-any.whl", hash = "sha256:88a1051873018da288eee8538d476dffe1262495144b33ecb586c4ab266bb8d4"}, {file = "mistune-2.0.2-py2.py3-none-any.whl", hash = "sha256:6bab6c6abd711c4604206c7d8cad5cd48b28f072b4bb75797d74146ba393a049"},
{file = "mistune-0.8.4.tar.gz", hash = "sha256:59a3429db53c50b5c6bcc8a07f8848cb00d7dc8bdb431a4ab41920d201d4756e"}, {file = "mistune-2.0.2.tar.gz", hash = "sha256:6fc88c3cb49dba8b16687b41725e661cf85784c12e8974a29b9d336dd596c3a1"},
] ]
packaging = [ packaging = [
{file = "packaging-20.9-py2.py3-none-any.whl", hash = "sha256:67714da7f7bc052e064859c05c595155bd1ee9f69f76557e21f051443c20947a"}, {file = "packaging-21.3-py3-none-any.whl", hash = "sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522"},
{file = "packaging-20.9.tar.gz", hash = "sha256:5b327ac1320dc863dca72f4514ecc086f31186744b84a230374cc1fd776feae5"}, {file = "packaging-21.3.tar.gz", hash = "sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb"},
] ]
pendulum = [ pendulum = [
{file = "pendulum-2.1.2-cp27-cp27m-macosx_10_15_x86_64.whl", hash = "sha256:b6c352f4bd32dff1ea7066bd31ad0f71f8d8100b9ff709fb343f3b86cee43efe"}, {file = "pendulum-2.1.2-cp27-cp27m-macosx_10_15_x86_64.whl", hash = "sha256:b6c352f4bd32dff1ea7066bd31ad0f71f8d8100b9ff709fb343f3b86cee43efe"},
@ -354,8 +359,8 @@ pexpect = [
{file = "pexpect-4.8.0.tar.gz", hash = "sha256:fc65a43959d153d0114afe13997d439c22823a27cefceb5ff35c2178c6784c0c"}, {file = "pexpect-4.8.0.tar.gz", hash = "sha256:fc65a43959d153d0114afe13997d439c22823a27cefceb5ff35c2178c6784c0c"},
] ]
pluggy = [ pluggy = [
{file = "pluggy-0.13.1-py2.py3-none-any.whl", hash = "sha256:966c145cd83c96502c3c3868f50408687b38434af77734af1e9ca461a4081d2d"}, {file = "pluggy-1.0.0-py2.py3-none-any.whl", hash = "sha256:74134bbf457f031a36d68416e1509f34bd5ccc019f0bcc952c7b909d06b37bd3"},
{file = "pluggy-0.13.1.tar.gz", hash = "sha256:15b2acde666561e1298d71b523007ed7364de07029219b604cf808bfa1c765b0"}, {file = "pluggy-1.0.0.tar.gz", hash = "sha256:4224373bacce55f955a878bf9cfa763c1e360858e330072059e10bad68531159"},
] ]
prompt-toolkit = [ prompt-toolkit = [
{file = "prompt_toolkit-3.0.3-py3-none-any.whl", hash = "sha256:c93e53af97f630f12f5f62a3274e79527936ed466f038953dfa379d4941f651a"}, {file = "prompt_toolkit-3.0.3-py3-none-any.whl", hash = "sha256:c93e53af97f630f12f5f62a3274e79527936ed466f038953dfa379d4941f651a"},
@ -366,24 +371,24 @@ ptyprocess = [
{file = "ptyprocess-0.7.0.tar.gz", hash = "sha256:5c5d0a3b48ceee0b48485e0c26037c0acd7d29765ca3fbb5cb3831d347423220"}, {file = "ptyprocess-0.7.0.tar.gz", hash = "sha256:5c5d0a3b48ceee0b48485e0c26037c0acd7d29765ca3fbb5cb3831d347423220"},
] ]
py = [ py = [
{file = "py-1.10.0-py2.py3-none-any.whl", hash = "sha256:3b80836aa6d1feeaa108e046da6423ab8f6ceda6468545ae8d02d9d58d18818a"}, {file = "py-1.11.0-py2.py3-none-any.whl", hash = "sha256:607c53218732647dff4acdfcd50cb62615cedf612e72d1724fb1a0cc6405b378"},
{file = "py-1.10.0.tar.gz", hash = "sha256:21b81bda15b66ef5e1a777a21c4dcd9c20ad3efd0b3f817e7a809035269e1bd3"}, {file = "py-1.11.0.tar.gz", hash = "sha256:51c75c4126074b472f746a24399ad32f6053d1b34b68d2fa41e558e6f4a98719"},
] ]
pygments = [ pygments = [
{file = "Pygments-2.9.0-py3-none-any.whl", hash = "sha256:d66e804411278594d764fc69ec36ec13d9ae9147193a1740cd34d272ca383b8e"}, {file = "Pygments-2.11.2-py3-none-any.whl", hash = "sha256:44238f1b60a76d78fc8ca0528ee429702aae011c265fe6a8dd8b63049ae41c65"},
{file = "Pygments-2.9.0.tar.gz", hash = "sha256:a18f47b506a429f6f4b9df81bb02beab9ca21d0a5fee38ed15aef65f0545519f"}, {file = "Pygments-2.11.2.tar.gz", hash = "sha256:4e426f72023d88d03b2fa258de560726ce890ff3b630f88c21cbb8b2503b8c6a"},
] ]
pyparsing = [ pyparsing = [
{file = "pyparsing-2.4.7-py2.py3-none-any.whl", hash = "sha256:ef9d7589ef3c200abe66653d3f1ab1033c3c419ae9b9bdb1240a85b024efc88b"}, {file = "pyparsing-3.0.7-py3-none-any.whl", hash = "sha256:a6c06a88f252e6c322f65faf8f418b16213b51bdfaece0524c1c1bc30c63c484"},
{file = "pyparsing-2.4.7.tar.gz", hash = "sha256:c203ec8783bf771a155b207279b9bccb8dea02d8f0c9e5f8ead507bc3246ecc1"}, {file = "pyparsing-3.0.7.tar.gz", hash = "sha256:18ee9022775d270c55187733956460083db60b37d0d0fb357445f3094eed3eea"},
] ]
pytest = [ pytest = [
{file = "pytest-6.2.5-py3-none-any.whl", hash = "sha256:7310f8d27bc79ced999e760ca304d69f6ba6c6649c0b60fb0e04a4a77cacc134"}, {file = "pytest-6.2.5-py3-none-any.whl", hash = "sha256:7310f8d27bc79ced999e760ca304d69f6ba6c6649c0b60fb0e04a4a77cacc134"},
{file = "pytest-6.2.5.tar.gz", hash = "sha256:131b36680866a76e6781d13f101efb86cf674ebb9762eb70d3082b6f29889e89"}, {file = "pytest-6.2.5.tar.gz", hash = "sha256:131b36680866a76e6781d13f101efb86cf674ebb9762eb70d3082b6f29889e89"},
] ]
python-dateutil = [ python-dateutil = [
{file = "python-dateutil-2.8.1.tar.gz", hash = "sha256:73ebfe9dbf22e832286dafa60473e4cd239f8592f699aa5adaf10050e6e1823c"}, {file = "python-dateutil-2.8.2.tar.gz", hash = "sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86"},
{file = "python_dateutil-2.8.1-py2.py3-none-any.whl", hash = "sha256:75bb3f31ea686f1197762692a9ee6a7550b59fc6ca3a1f4b5d7e32fb98e2da2a"}, {file = "python_dateutil-2.8.2-py2.py3-none-any.whl", hash = "sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9"},
] ]
pytzdata = [ pytzdata = [
{file = "pytzdata-2020.1-py2.py3-none-any.whl", hash = "sha256:e1e14750bcf95016381e4d472bad004eef710f2d6417240904070b3d6654485f"}, {file = "pytzdata-2020.1-py2.py3-none-any.whl", hash = "sha256:e1e14750bcf95016381e4d472bad004eef710f2d6417240904070b3d6654485f"},
@ -402,15 +407,14 @@ toml = [
{file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"}, {file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"},
] ]
typing-extensions = [ typing-extensions = [
{file = "typing_extensions-3.10.0.0-py2-none-any.whl", hash = "sha256:0ac0f89795dd19de6b97debb0c6af1c70987fd80a2d62d1958f7e56fcc31b497"}, {file = "typing_extensions-4.0.1-py3-none-any.whl", hash = "sha256:7f001e5ac290a0c0401508864c7ec868be4e701886d5b573a9528ed3973d9d3b"},
{file = "typing_extensions-3.10.0.0-py3-none-any.whl", hash = "sha256:779383f6086d90c99ae41cf0ff39aac8a7937a9283ce0a414e5dd782f4c94a84"}, {file = "typing_extensions-4.0.1.tar.gz", hash = "sha256:4ca091dea149f945ec56afb48dae714f21e8692ef22a395223bcd328961b6a0e"},
{file = "typing_extensions-3.10.0.0.tar.gz", hash = "sha256:50b6f157849174217d0656f99dc82fe932884fb250826c18350e159ec6cdf342"},
] ]
wcwidth = [ wcwidth = [
{file = "wcwidth-0.1.9-py2.py3-none-any.whl", hash = "sha256:cafe2186b3c009a04067022ce1dcd79cb38d8d65ee4f4791b8888d6599d1bbe1"}, {file = "wcwidth-0.1.9-py2.py3-none-any.whl", hash = "sha256:cafe2186b3c009a04067022ce1dcd79cb38d8d65ee4f4791b8888d6599d1bbe1"},
{file = "wcwidth-0.1.9.tar.gz", hash = "sha256:ee73862862a156bf77ff92b09034fc4825dd3af9cf81bc5b360668d425f3c5f1"}, {file = "wcwidth-0.1.9.tar.gz", hash = "sha256:ee73862862a156bf77ff92b09034fc4825dd3af9cf81bc5b360668d425f3c5f1"},
] ]
zipp = [ zipp = [
{file = "zipp-3.4.1-py3-none-any.whl", hash = "sha256:51cb66cc54621609dd593d1787f286ee42a5c0adbb4b29abea5a63edc3e03098"}, {file = "zipp-3.6.0-py3-none-any.whl", hash = "sha256:9fe5ea21568a0a70e50f273397638d39b03353731e6cbbb3fd8502a33fec40bc"},
{file = "zipp-3.4.1.tar.gz", hash = "sha256:3607921face881ba3e026887d8150cca609d517579abe052ac81fc5aeffdbd76"}, {file = "zipp-3.6.0.tar.gz", hash = "sha256:71c644c5369f4a6e07636f0aa966270449561fcea2e3d6747b8d23efaa9d7832"},
] ]

View file

@ -1,6 +1,6 @@
[tool.poetry] [tool.poetry]
name = "iredis" name = "iredis"
version = "1.10.0" version = "1.11.0"
description = "Terminal client for Redis with auto-completion and syntax highlighting." description = "Terminal client for Redis with auto-completion and syntax highlighting."
authors = ["laixintao <laixintao1995@163.com>"] authors = ["laixintao <laixintao1995@163.com>"]
readme = 'README.md' readme = 'README.md'
@ -35,7 +35,7 @@ python = "^3.6"
redis = "^3.4.0" redis = "^3.4.0"
prompt_toolkit = "^3" prompt_toolkit = "^3"
Pygments = "^2" Pygments = "^2"
mistune = "^0.8" mistune = "^2.0"
configobj = "^5.0" configobj = "^5.0"
click = "^7.0" click = "^7.0"
pendulum = "^2.0" pendulum = "^2.0"

View file

@ -405,7 +405,7 @@ def test_xread(judge_command):
"count": "2", "count": "2",
"streams": "STREAMS", "streams": "STREAMS",
# FIXME current grammar can't support multiple tokens # FIXME current grammar can't support multiple tokens
# so the ids will be recongized to keys. # so the ids will be recognized to keys.
"keys": "mystream writers 0-0", "keys": "mystream writers 0-0",
"stream_id": "0-0", "stream_id": "0-0",
}, },

View file

@ -68,10 +68,10 @@ def test_do_help(config):
client = Client("127.0.0.1", "6379", None) client = Client("127.0.0.1", "6379", None)
config.version = "5.0.0" config.version = "5.0.0"
resp = client.do_help("SET") resp = client.do_help("SET")
assert resp[10] == ("", "1.0.0 (Avaiable on your redis-server: 5.0.0)") assert resp[10] == ("", "1.0.0 (Available on your redis-server: 5.0.0)")
config.version = "2.0.0" config.version = "2.0.0"
resp = client.do_help("cluster", "addslots") resp = client.do_help("cluster", "addslots")
assert resp[10] == ("", "3.0.0 (Not avaiable on your redis-server: 2.0.0)") assert resp[10] == ("", "3.0.0 (Not available on your redis-server: 2.0.0)")
def test_rainbow_iterator(): def test_rainbow_iterator():