summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-11-21 06:30:52 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-11-21 06:30:52 +0000
commit5cb9305854d1b7d7e570b76b4d52e64a77022441 (patch)
treed3bdad5c012f4f53a23053affb04f779e6e92e7b
parentReleasing debian version 1.28.0-1. (diff)
downloadmycli-5cb9305854d1b7d7e570b76b4d52e64a77022441.tar.xz
mycli-5cb9305854d1b7d7e570b76b4d52e64a77022441.zip
Disabling fzf until pyfzf has passed NEW (Closes: #1087961).
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
-rw-r--r--debian/patches/debian/0001-disable-fzf.patch65
-rw-r--r--debian/patches/series1
2 files changed, 66 insertions, 0 deletions
diff --git a/debian/patches/debian/0001-disable-fzf.patch b/debian/patches/debian/0001-disable-fzf.patch
new file mode 100644
index 0000000..eaa7cee
--- /dev/null
+++ b/debian/patches/debian/0001-disable-fzf.patch
@@ -0,0 +1,65 @@
+Author: Daniel Baumann <daniel.baumann@progress-linux.org>
+Description: Disabling fzf until pyfzf has passed NEW (Closes: #1087961).
+
+diff -Naurp mycli.orig/mycli/packages/toolkit/fzf.py mycli/mycli/packages/toolkit/fzf.py
+--- mycli.orig/mycli/packages/toolkit/fzf.py
++++ mycli/mycli/packages/toolkit/fzf.py
+@@ -1,45 +1,14 @@
+ from shutil import which
+
+-from pyfzf import FzfPrompt
+ from prompt_toolkit import search
+ from prompt_toolkit.key_binding.key_processor import KeyPressEvent
+
+ from .history import FileHistoryWithTimestamp
+
+
+-class Fzf(FzfPrompt):
+- def __init__(self):
+- self.executable = which("fzf")
+- if self.executable:
+- super().__init__()
+-
+- def is_available(self) -> bool:
+- return self.executable is not None
+-
+-
+ def search_history(event: KeyPressEvent):
+ buffer = event.current_buffer
+ history = buffer.history
+
+- fzf = Fzf()
+-
+- if fzf.is_available() and isinstance(history, FileHistoryWithTimestamp):
+- history_items_with_timestamp = history.load_history_with_timestamp()
+-
+- formatted_history_items = []
+- original_history_items = []
+- for item, timestamp in history_items_with_timestamp:
+- formatted_item = item.replace('\n', ' ')
+- timestamp = timestamp.split(".")[0] if "." in timestamp else timestamp
+- formatted_history_items.append(f"{timestamp} {formatted_item}")
+- original_history_items.append(item)
+-
+- result = fzf.prompt(formatted_history_items, fzf_options="--tiebreak=index")
+-
+- if result:
+- selected_index = formatted_history_items.index(result[0])
+- buffer.text = original_history_items[selected_index]
+- buffer.cursor_position = len(buffer.text)
+- else:
+- # Fallback to default reverse incremental search
+- search.start_search(direction=search.SearchDirection.BACKWARD)
++ # Fallback to default reverse incremental search
++ search.start_search(direction=search.SearchDirection.BACKWARD)
+diff -Naurp mycli.orig/setup.py mycli/setup.py
+--- mycli.orig/setup.py 2024-11-15 07:48:27.438686616 +0100
++++ mycli/setup.py 2024-11-21 07:25:19.265039508 +0100
+@@ -30,7 +30,6 @@ install_requirements = [
+ 'cli_helpers[styles] >= 2.2.1',
+ 'pyperclip >= 1.8.1',
+ 'pyaes >= 1.6.1',
+- 'pyfzf >= 0.3.1',
+ ]
+
+ if sys.version_info.minor < 9:
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..ea52987
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+debian/0001-disable-fzf.patch