Skip to content

Commit

Permalink
refactor: moved ./static into ./gptme/server/static
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikBjare committed Oct 5, 2024
1 parent 7d5392c commit b47a7bc
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions gptme/server/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@ def api_conversation_generate(logfile: str):


gptme_path_ctx = resources.as_file(resources.files("gptme"))
static_path = gptme_path_ctx.__enter__().parent / "static"
root_path = gptme_path_ctx.__enter__()
static_path = root_path / "server" / "static"
media_path = root_path.parent / "media"
atexit.register(gptme_path_ctx.__exit__, None, None, None)


Expand All @@ -143,7 +145,7 @@ def root():

@api.route("/favicon.png")
def favicon():
return flask.send_from_directory(static_path.parent / "media", "logo.png")
return flask.send_from_directory(media_path, "logo.png")


def create_app() -> flask.Flask:
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ packages = [
{ include = "gptme" },
]

include = ["static/**/*", "media/logo.png"]
include = ["gptme/server/static/**/*", "media/logo.png"]

[tool.poetry.scripts]
gptme = "gptme.cli:main"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_reduce.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# Some large files
readme = root / "README.md"
cli = root / "gptme" / "cli.py"
htmlindex = root / "static" / "index.html"
htmlindex = root / "gptme" / "server" / "static" / "index.html"

long_msg = Message(
"system",
Expand Down

0 comments on commit b47a7bc

Please sign in to comment.