Skip to content

Commit

Permalink
cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanCarloMachado committed Jun 15, 2024
1 parent 4b6c269 commit 4e5a936
Show file tree
Hide file tree
Showing 18 changed files with 24 additions and 208 deletions.
Binary file modified .DS_Store
Binary file not shown.
3 changes: 0 additions & 3 deletions .flake8

This file was deleted.

47 changes: 0 additions & 47 deletions .pre-commit-config.yaml

This file was deleted.

3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@

# PythonSearch

With python search you collect and retrieve and refactor information efficiently.
Python search is a minimal search engine writting in python for developers productivity.
With PythoSearch you collect and retrieve and refactor information efficiently.

- collect commands, scripts, prompts, snippets, urls, files, efficiently as python dictionaries
- retrieve or execute the registered entries (depending on the type) either by searching them or invoking them via shortcuts
Expand Down
21 changes: 0 additions & 21 deletions python_search/config.py

This file was deleted.

1 change: 1 addition & 0 deletions python_search/configuration/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from python_search.entries_group import EntriesGroup


class PythonSearchConfiguration(EntriesGroup):
"""
The main configuration of Python Search
Expand Down
71 changes: 0 additions & 71 deletions python_search/data_exporter.py

This file was deleted.

17 changes: 0 additions & 17 deletions python_search/entry_capture/utils.py

This file was deleted.

6 changes: 4 additions & 2 deletions python_search/entry_change.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from python_search.host_system.system_paths import SystemPaths


class EntryChangeDetector:
HASH_FILE = "/tmp/entries_md5"

Expand Down Expand Up @@ -29,8 +30,9 @@ def current_entries_md5(self) -> str:
try:
import subprocess


output = subprocess.getoutput(SystemPaths.BINARIES_PATH+"/pys _entries_loader load_entries_as_json")
output = subprocess.getoutput(
SystemPaths.BINARIES_PATH + "/pys _entries_loader load_entries_as_json"
)
result = hashlib.md5(output.encode())
result = result.hexdigest()
except Exception:
Expand Down
1 change: 1 addition & 0 deletions python_search/entry_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
decode_serialized_data_from_entry_text,
)


class EntryRunner:
"""
Responsible to execute the entries matched
Expand Down
1 change: 1 addition & 0 deletions python_search/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def not_valid_command(entity, cmd):
f"Not Valid {entity.__class__.__name__} command {cmd}"
)


class RunException(Exception):
@staticmethod
def key_does_not_exist(key: str):
Expand Down
9 changes: 3 additions & 6 deletions python_search/host_system/system_paths.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@



class SystemPaths:
BINARIES_PATH = '/Users/jean.machado/miniconda3/envs/python312/bin'
KITTY_BINNARY = '/Applications/kitty.app/Contents/MacOS/kitty'
VIM_BINNARY = '/usr/bin/vim'
BINARIES_PATH = "/Users/jean.machado/miniconda3/envs/python312/bin"
KITTY_BINNARY = "/Applications/kitty.app/Contents/MacOS/kitty"
VIM_BINNARY = "/usr/bin/vim"
1 change: 1 addition & 0 deletions python_search/interpreter/interpreter_matcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
CmdInterpreter,
]


class InterpreterMatcher:
"""
Matches a query with an entry interpreter
Expand Down
3 changes: 1 addition & 2 deletions python_search/search/search_ui/kitty.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class KittySearch:
Renders the search ui using fzf + termite terminal
"""

_DEFAULT_WINDOW_SIZE = (955, 230)
_DEFAULT_WINDOW_SIZE = (990, 170)

_configuration = None

Expand Down Expand Up @@ -52,7 +52,6 @@ def launch(self) -> None:
terminal = Terminal()
from python_search.host_system.system_paths import SystemPaths


launch_cmd = f"""{get_kitty_cmd()} \
--title {self._title} \
--listen-on unix:/tmp/mykitty \
Expand Down
2 changes: 1 addition & 1 deletion python_search/search/search_ui/terminal_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class SearchTerminalUi:
MAX_LINE_SIZE = 80
MAX_KEY_SIZE = 45
MAX_CONTENT_SIZE = 45
NUMBER_ENTRIES_TO_RETURN = 10
NUMBER_ENTRIES_TO_RETURN = 6

_documents_future = None
commands = None
Expand Down
1 change: 1 addition & 0 deletions python_search/share_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from python_search.core_entities.core_entities import Entry, Key
from python_search.error.exception import notify_exception


class ShareEntry:
def __init__(self):
self._entries = ConfigurationLoader().load_entries()
Expand Down
17 changes: 8 additions & 9 deletions python_search/theme.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,16 @@ class ThemeSelector:
HOUR_TO = 17

def get_theme(self) -> str:

"""
Returns the theme to use based on the current time
"""
import os ; home = os.environ['HOME']
if os.path.exists(home + '/.python_search/theme'):
theme = open(home + '/.python_search/theme').read().strip()
if theme == 'Desert':
return DesertTheme()

import os

home = os.environ["HOME"]
if os.path.exists(home + "/.python_search/theme"):
theme = open(home + "/.python_search/theme").read().strip()
if theme == "Desert":
return DesertTheme()

now = datetime.datetime.now()
if now.hour >= self.HOUR_FROM and now.hour <= self.HOUR_TO:
Expand All @@ -38,7 +37,7 @@ def __init__(self):
self.backgroud = self.colors["backgroud"]
self.text = self.colors["text"]

self.font_size = 16
self.font_size = 17
self.font = "SF Pro"


Expand Down Expand Up @@ -92,5 +91,5 @@ def __init__(self):
super().__init__()


def get_current_theme():
def get_current_theme() -> BaseTheme:
return ThemeSelector().get_theme()
28 changes: 0 additions & 28 deletions wrap_log_command.sh

This file was deleted.

0 comments on commit 4e5a936

Please sign in to comment.