Skip to content

Commit

Permalink
Merge pull request #26 from Garulf/fix-cache
Browse files Browse the repository at this point in the history
Fix cache
  • Loading branch information
Garulf committed Feb 20, 2024
2 parents b82f7bf + d35d842 commit d7df964
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VENV = venv
VENV = .venv
PYTHON = $(VENV)/bin/python3
PIP = $(VENV)/bin/pip
PLUGIN_NAME = $(shell jq -r '.Name' ./src/plugin.json | tr " " "-")
Expand All @@ -7,17 +7,17 @@ PLUGIN_DIR = $(PLUGIN_NAME)-$(PLUGIN_VERSION)
ZIP_FILE = $(PLUGIN_DIR).zip


venv:
.venv:
python3 -m venv $(VENV)
$(PIP) install -r requirements.txt
$(PIP) install -r requirements-dev.txt

init: venv
init: .venv

test: venv
test: .venv
$(PYTHON) -m pytest

tox: venv
tox: .venv
$(PYTHON) -m tox

cleanvenv:
Expand Down
3 changes: 3 additions & 0 deletions src/__main__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import requests_cache

from plugin import main


if __name__ == '__main__':
requests_cache.install_cache(".cache", backend="sqlite", expire_after=300)
main()
4 changes: 1 addition & 3 deletions src/plugin.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
from typing import Optional

from pyflowlauncher import Plugin
import requests_cache

from query import query
from context_menu import context_menu


def main(plugin: Optional[Plugin] = None):
requests_cache.install_cache(".cache", backend="sqlite", expire_after=300)

plugin = plugin or Plugin()

plugin.add_method(query)
Expand Down

0 comments on commit d7df964

Please sign in to comment.