Skip to content

Commit

Permalink
cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanCarloMachado committed Jun 1, 2024
1 parent f173dc4 commit 53d43fa
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 3 additions & 1 deletion python_search/configuration/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ def __init__(
default_text_editor: Optional[str] = None,
fzf_theme: Literal["light", "solarized"] = "light",
custom_window_size: Optional[Tuple[int, int]] = None,
rerank_via_model=None,
collect_data: bool = False,
entry_generation=False,
privacy_sensitive_terms: Optional[List[str]] = None,
Expand Down Expand Up @@ -92,6 +91,9 @@ def is_rerank_via_model_enabled(self):

return self._rerank_via_model_enabled

def get_python_installation_path(self):
return "/Users/jean.machado/miniconda3/envs/python312/bin"

def get_default_tags(self):
return self._default_tags

Expand Down
4 changes: 1 addition & 3 deletions python_search/entry_capture/entries_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def _edit_file(self, file_name: str, line: Optional[int] = 30, dry_run=False):
cmd: str = (
f" {get_kitty_cmd()} {terminal.GENERIC_TERMINAL_PARAMS} bash -c 'cd"
f" {self.configuration.get_project_root()} "
f"; {self._get_open_text_editor_command(file_name, line)} && llm_cli t5_embeddings save_missing_keys "
f"; {self._get_open_text_editor_command(file_name, line) }"
)
print(cmd)

Expand All @@ -85,8 +85,6 @@ def _edit_file(self, file_name: str, line: Optional[int] = 30, dry_run=False):
def _get_open_text_editor_command(self, file, line):
if self.configuration.get_text_editor() == "vim":
return f"{self.configuration.get_text_editor()} {file} +{line}'"
elif self.configuration.get_text_editor() == "myvim":
return f"{self.configuration.get_text_editor()} {file} --line={line}'"
else:
# if is not a known editor just open the file
return f"{self.configuration.get_text_editor()} {file}'"
Expand Down
6 changes: 3 additions & 3 deletions python_search/interpreter/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def get_executable(self):
filename, file_extension = os.path.splitext(self.cmd["file"])

if file_extension in [".py", ".vim", ".", ".rc", ".yaml", ".yml", ".conf"]:
return "docker_nvim"
return "vim"

if os.path.isdir(self.cmd["file"]):
if is_mac():
Expand All @@ -51,15 +51,15 @@ def get_executable(self):
elif file_extension == ".ipynb":
return "pycharm"

return "docker_nvim"
return "vim"

def interpret_default(self):
executable = self.get_executable()

cmd = f'{executable} "{self.cmd["file"]}"'

final_cmd = self.cmd
if executable in ["vim", "docker_nvim"]:
if executable in ["vim"]:
final_cmd["cli_cmd"] = cmd
else:
final_cmd["cmd"] = cmd
Expand Down
2 changes: 1 addition & 1 deletion python_search/search/search_ui/search_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def copy_entry_value_to_clipboard(self, entry_key):

def edit_key(self, key):
Popen(
f'entries_editor edit_key "{key}" &>/dev/null',
f'/Users/jean.machado/miniconda3/envs/python312/bin/entries_editor edit_key "{key}" ',
stdout=None,
stderr=None,
shell=True,
Expand Down

0 comments on commit 53d43fa

Please sign in to comment.