From a3423c29bb29af676bbe64ba3646334000fdcc02 Mon Sep 17 00:00:00 2001 From: AeneasChristodoulou Date: Fri, 10 Mar 2023 16:14:16 -0500 Subject: [PATCH 1/4] fixing is_linux(), adding creation of non-existing entries with gpt --- python_search/apps/browser.py | 3 +++ python_search/entry_generator.py | 2 +- python_search/environment.py | 2 +- python_search/search_ui/fzf.py | 1 + typescript | 3 +++ 5 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 typescript diff --git a/python_search/apps/browser.py b/python_search/apps/browser.py index a2e6ab59..7d368801 100644 --- a/python_search/apps/browser.py +++ b/python_search/apps/browser.py @@ -49,6 +49,9 @@ def open_shell_cmd( if browser == "firefox": return self._firefox(url_expr) + if is_linux(): + return self._firefox(url_expr) + return self._chrome(url_expr) def _firefox(self, url): diff --git a/python_search/entry_generator.py b/python_search/entry_generator.py index 2cf4e278..a755131d 100644 --- a/python_search/entry_generator.py +++ b/python_search/entry_generator.py @@ -26,4 +26,4 @@ def generate_body(self, entry_description, body_size=500): if __name__ == "__main__": import fire - fire.Fire(EntryGenerator()) \ No newline at end of file + fire.Fire(EntryGenerator()) diff --git a/python_search/environment.py b/python_search/environment.py index 37f01f43..85890b64 100644 --- a/python_search/environment.py +++ b/python_search/environment.py @@ -12,4 +12,4 @@ def is_archlinux(): def is_linux(): - return 0 == os.system("/etc/*release | grep -i linux") + return 0 == os.system("cat /etc/*release | grep -i linux") diff --git a/python_search/search_ui/fzf.py b/python_search/search_ui/fzf.py index 356284e2..0aba2cec 100644 --- a/python_search/search_ui/fzf.py +++ b/python_search/search_ui/fzf.py @@ -54,6 +54,7 @@ def get_cmd(self): --bind "esc:+clear-query" \ --bind "ctrl-k:abort" \ --bind "ctrl-d:abort" \ + --bind "ctrl-g:execute-silent:(prompt_editor --prompt_text {{q}})" \ {self._get_fzf_theme()} ; exit 0 ' """ diff --git a/typescript b/typescript new file mode 100644 index 00000000..aafbe3d8 --- /dev/null +++ b/typescript @@ -0,0 +1,3 @@ +Script started on 2023-03-10 14:40:11-05:00 [TERM="xterm-kitty" TTY="/dev/pts/3" COLUMNS="213" LINES="50"] +]0;actwo@actwo:~/projects/PythonSearch[?2004h[actwo@actwo PythonSearch]$ timedatectl set-ntp truescripts +[?2004l [?2004h[?1049h(B[?7h[?1h[?1h[?25l(B(B[ Reading... ](B(B[ Read 91 lines ](B(B GNU nano 7.2 /home/actwo/projects/Scripts/startup.sh (B (B^G(B Help(B^O(B Write Out (B^W(B Where Is(B^K(B Cut(B^T(B Execute(B^C(B Location(BM-U(B Undo(BM-A(B Set Mark (BM-](B To Bracket (BM-Q(B Previous (B^B(B Back(B^◂(B Prev Word (B^X(B Exit(B^R(B Read File (B^\(B Replace(B^U(B Paste(B^J(B Justify(B^/(B Go To Line (BM-E(B Redo(BM-6(B Copy(B^Q(B Where Was (BM-W(B Next(B^F(B Forward(B^▸(B Next Word #!/bin/bash # New Path (Bexport(B PATH=(B"/home/actwo/.local/bin:$PATH" (B# Git Commit Function function(B gitcommit {(Bgit add .git commit -m (B"$1"(Bgit push } # cd into projects folder (Balias(B cdprojects=(B"cd /home/actwo/projects/" (B#cd into projects/PythonTests Folder (Balias(B cdpythontests=(B"cd /home/actwo/projects/pythonTests/" (B# cd scripts (Balias(B cdscripts=(B"cd /home/actwo/projects/Scripts/" (B# Update and Upgrade Function function(B update {(Bsudo apt-get updatesudo apt-get upgrade }  # source Scripts (Balias(B sourcescripts=(B"source /home/actwo/projects/Scripts/startup.sh" (B# cd to Hashcat (Balias(B cdhashcat=(B"cd /home/actwo/projects/hashcat-6.2.5/" (B # Edit this File (Balias(B scripts=(B"nano /home/actwo/projects/Scripts/startup.sh" (B# Converting Hashcat.bin to Hashcat (Balias(B hashcat=(B"./hashcat.bin" (B#cd HashcatUI (Balias(B cdhashcatui=(B"cd /home/actwo/projects/HashcatUI/" (B#cd ML-Folder (Balias(B cdml=(B"cd /home/actwo/projects/ML/" (B[?12h[?25h[?25l[?12h[?25h[?25l[?12h[?25h[?25l[?12h[?25h[?25l[?12h[?25h[?25l[?12h[?25h78#add pysearch_entries path (Bexport(B PATH=(B"/home/actwo/projects/ac_pysearch_entries:$PATH" (B#firefox as standardbrowser (B[?25l[?12h[?25h78(Bexport(B BROWSER=(Bfirefox #add scripts folder to path (Bexport(B PATH=(B"/home/actwo/projects/Scripts:$PATH" (B#export java (Bexport(B JAVA_HOME[32 \ No newline at end of file From b7fe4579842d50ada426c67a8b70205fde00cf22 Mon Sep 17 00:00:00 2001 From: AeneasChristodoulou <81275325+AeneasChristodoulou@users.noreply.github.com> Date: Fri, 10 Mar 2023 16:18:36 -0500 Subject: [PATCH 2/4] Update CHANGELOG.md --- CHANGELOG.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 54e3cbd4..32e7da9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 0.10.15 + +- Press CTRL+G when searching for an entry, that doesn't exist yet, to auto generate it and save it with GPT3 +- Fixing is_linux() and url entry behaviour on linux + ## 0.10.14 - Added examples for body generation @@ -9,10 +14,10 @@ ## 0.10.13 --Adding support for XFCE --Removing more legacy i3 Code --New is_linux function --Changing default browser logic +- Adding support for XFCE +- Removing more legacy i3 Code +- New is_linux function +- Changing default browser logic ## 0.10.11 From ee779d90675f8b5ead3131f9ce2f35186e46c889 Mon Sep 17 00:00:00 2001 From: AeneasChristodoulou <81275325+AeneasChristodoulou@users.noreply.github.com> Date: Fri, 10 Mar 2023 16:19:02 -0500 Subject: [PATCH 3/4] Update pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index d6e3d590..e5e1b52d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "python-search" -version = "0.10.14" +version = "0.10.15" description = "Build your knowledge database in python and retrieve it efficiently" authors = ["Jean Carlo Machado "] From cc9cc88867bf3e2ff7515e817b7771e644dc94b2 Mon Sep 17 00:00:00 2001 From: AeneasChristodoulou <81275325+AeneasChristodoulou@users.noreply.github.com> Date: Fri, 10 Mar 2023 16:23:53 -0500 Subject: [PATCH 4/4] Delete typescript --- typescript | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 typescript diff --git a/typescript b/typescript deleted file mode 100644 index aafbe3d8..00000000 --- a/typescript +++ /dev/null @@ -1,3 +0,0 @@ -Script started on 2023-03-10 14:40:11-05:00 [TERM="xterm-kitty" TTY="/dev/pts/3" COLUMNS="213" LINES="50"] -]0;actwo@actwo:~/projects/PythonSearch[?2004h[actwo@actwo PythonSearch]$ timedatectl set-ntp truescripts -[?2004l [?2004h[?1049h(B[?7h[?1h[?1h[?25l(B(B[ Reading... ](B(B[ Read 91 lines ](B(B GNU nano 7.2 /home/actwo/projects/Scripts/startup.sh (B (B^G(B Help(B^O(B Write Out (B^W(B Where Is(B^K(B Cut(B^T(B Execute(B^C(B Location(BM-U(B Undo(BM-A(B Set Mark (BM-](B To Bracket (BM-Q(B Previous (B^B(B Back(B^◂(B Prev Word (B^X(B Exit(B^R(B Read File (B^\(B Replace(B^U(B Paste(B^J(B Justify(B^/(B Go To Line (BM-E(B Redo(BM-6(B Copy(B^Q(B Where Was (BM-W(B Next(B^F(B Forward(B^▸(B Next Word #!/bin/bash # New Path (Bexport(B PATH=(B"/home/actwo/.local/bin:$PATH" (B# Git Commit Function function(B gitcommit {(Bgit add .git commit -m (B"$1"(Bgit push } # cd into projects folder (Balias(B cdprojects=(B"cd /home/actwo/projects/" (B#cd into projects/PythonTests Folder (Balias(B cdpythontests=(B"cd /home/actwo/projects/pythonTests/" (B# cd scripts (Balias(B cdscripts=(B"cd /home/actwo/projects/Scripts/" (B# Update and Upgrade Function function(B update {(Bsudo apt-get updatesudo apt-get upgrade }  # source Scripts (Balias(B sourcescripts=(B"source /home/actwo/projects/Scripts/startup.sh" (B# cd to Hashcat (Balias(B cdhashcat=(B"cd /home/actwo/projects/hashcat-6.2.5/" (B # Edit this File (Balias(B scripts=(B"nano /home/actwo/projects/Scripts/startup.sh" (B# Converting Hashcat.bin to Hashcat (Balias(B hashcat=(B"./hashcat.bin" (B#cd HashcatUI (Balias(B cdhashcatui=(B"cd /home/actwo/projects/HashcatUI/" (B#cd ML-Folder (Balias(B cdml=(B"cd /home/actwo/projects/ML/" (B[?12h[?25h[?25l[?12h[?25h[?25l[?12h[?25h[?25l[?12h[?25h[?25l[?12h[?25h[?25l[?12h[?25h78#add pysearch_entries path (Bexport(B PATH=(B"/home/actwo/projects/ac_pysearch_entries:$PATH" (B#firefox as standardbrowser (B[?25l[?12h[?25h78(Bexport(B BROWSER=(Bfirefox #add scripts folder to path (Bexport(B PATH=(B"/home/actwo/projects/Scripts:$PATH" (B#export java (Bexport(B JAVA_HOME[32 \ No newline at end of file