summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-07-13 11:04:05 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-07-13 11:04:05 +0000
commit223d5550ef8d557a4151b12051034d36e75d6b80 (patch)
tree68c1a15c3637dc4da47ac7f2ab1c50bb443530c5
parentAdding upstream version 1.11.0. (diff)
downloadlitecli-upstream/1.11.1.tar.xz
litecli-upstream/1.11.1.zip
Adding upstream version 1.11.1.upstream/1.11.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
-rw-r--r--CHANGELOG.md7
-rw-r--r--litecli/__init__.py2
-rw-r--r--litecli/main.py2
-rw-r--r--litecli/packages/parseutils.py8
-rw-r--r--litecli/packages/special/iocommands.py4
-rw-r--r--litecli/sqlcompleter.py2
-rw-r--r--tests/test_sqlexecute.py2
7 files changed, 17 insertions, 10 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9530cd7..ee3d972 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,10 @@
+## 1.11.1 - 2024-07-04
+
+### Bug Fixes
+
+* Fix the escape sequence warning.
+
+
## 1.11.0 - 2024-05-03
### Improvements
diff --git a/litecli/__init__.py b/litecli/__init__.py
index f84c53b..c3fa782 100644
--- a/litecli/__init__.py
+++ b/litecli/__init__.py
@@ -1 +1 @@
-__version__ = "1.11.0"
+__version__ = "1.11.1"
diff --git a/litecli/main.py b/litecli/main.py
index ebbc5ba..6dc9dff 100644
--- a/litecli/main.py
+++ b/litecli/main.py
@@ -329,7 +329,7 @@ class LiteCli(object):
exit(1)
def handle_editor_command(self, text):
- """Editor command is any query that is prefixed or suffixed by a '\e'.
+ R"""Editor command is any query that is prefixed or suffixed by a '\e'.
The reason for a while loop is because a user might edit a query
multiple times. For eg:
diff --git a/litecli/packages/parseutils.py b/litecli/packages/parseutils.py
index f5fdc1d..d5fd197 100644
--- a/litecli/packages/parseutils.py
+++ b/litecli/packages/parseutils.py
@@ -12,12 +12,12 @@ cleanup_regex = {
# This matches everything except spaces, parens, colon, comma, and period
"most_punctuations": re.compile(r"([^\.():,\s]+)$"),
# This matches everything except a space.
- "all_punctuations": re.compile("([^\s]+)$"),
+ "all_punctuations": re.compile(r"([^\s]+)$"),
}
def last_word(text, include="alphanum_underscore"):
- """
+ R"""
Find the last word in a sentence.
>>> last_word('abc')
@@ -41,9 +41,9 @@ def last_word(text, include="alphanum_underscore"):
>>> last_word('bac $def', include='most_punctuations')
'$def'
>>> last_word('bac \def', include='most_punctuations')
- '\\\\def'
+ '\\def'
>>> last_word('bac \def;', include='most_punctuations')
- '\\\\def;'
+ '\\def;'
>>> last_word('bac::def', include='most_punctuations')
'def'
"""
diff --git a/litecli/packages/special/iocommands.py b/litecli/packages/special/iocommands.py
index ee254f0..c1596eb 100644
--- a/litecli/packages/special/iocommands.py
+++ b/litecli/packages/special/iocommands.py
@@ -121,7 +121,7 @@ def get_editor_query(sql):
# The reason we can't simply do .strip('\e') is that it strips characters,
# not a substring. So it'll strip "e" in the end of the sql also!
# Ex: "select * from style\e" -> "select * from styl".
- pattern = re.compile("(^\\\e|\\\e$)")
+ pattern = re.compile(r"(^\\e|\\e$)")
while pattern.search(sql):
sql = pattern.sub("", sql)
@@ -245,7 +245,7 @@ def subst_favorite_query_args(query, args):
+ query,
]
- match = re.search("\\?|\\$\d+", query)
+ match = re.search(r"\?|\$\d+", query)
if match:
return [
None,
diff --git a/litecli/sqlcompleter.py b/litecli/sqlcompleter.py
index 82b8d87..68252ea 100644
--- a/litecli/sqlcompleter.py
+++ b/litecli/sqlcompleter.py
@@ -257,7 +257,7 @@ class SQLCompleter(Completer):
self.reserved_words = set()
for x in self.keywords:
self.reserved_words.update(x.split())
- self.name_pattern = compile("^[_a-z][_a-z0-9\$]*$")
+ self.name_pattern = compile(r"^[_a-z][_a-z0-9\$]*$")
self.special_commands = []
self.table_formats = supported_formats
diff --git a/tests/test_sqlexecute.py b/tests/test_sqlexecute.py
index 16bad74..cd56683 100644
--- a/tests/test_sqlexecute.py
+++ b/tests/test_sqlexecute.py
@@ -309,7 +309,7 @@ def test_favorite_query_expanded_output(executor):
results = run(executor, "\\fs test-ae select * from test")
assert_result_equal(results, status="Saved.")
- results = run(executor, "\\f+ test-ae \G")
+ results = run(executor, R"\f+ test-ae \G")
assert is_expanded_output() is True
assert_result_equal(
results,