Skip to content

Commit 903e699

Browse files
make TEMPLATES lowercase
1 parent 63b5f23 commit 903e699

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

src/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@
2121
{"name": "ApiAnalytics", "url": "https://github.com/tom-draper/api-analytics"},
2222
]
2323

24-
TEMPLATES = Jinja2Templates(directory="templates")
24+
templates = Jinja2Templates(directory="templates")

src/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from slowapi.errors import RateLimitExceeded
1111
from starlette.middleware.trustedhost import TrustedHostMiddleware
1212

13-
from config import TEMPLATES
13+
from config import templates
1414
from routers import download, dynamic, index
1515
from server_utils import limiter
1616
from utils import lifespan, rate_limit_exception_handler
@@ -89,7 +89,7 @@ async def api_docs(request: Request) -> HTMLResponse:
8989
HTMLResponse
9090
A rendered HTML page displaying API documentation.
9191
"""
92-
return TEMPLATES.TemplateResponse("api.jinja", {"request": request})
92+
return templates.TemplateResponse("api.jinja", {"request": request})
9393

9494

9595
@app.get("/robots.txt")

src/query_processor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from fastapi import Request
66
from starlette.templating import _TemplateResponse
77

8-
from config import EXAMPLE_REPOS, MAX_DISPLAY_SIZE, TEMPLATES
8+
from config import EXAMPLE_REPOS, MAX_DISPLAY_SIZE, templates
99
from gitingest.query_ingestion import run_ingest_query
1010
from gitingest.query_parser import ParsedQuery, parse_query
1111
from gitingest.repository_clone import CloneConfig, clone_repo
@@ -61,7 +61,7 @@ async def process_query(
6161
raise ValueError(f"Invalid pattern type: {pattern_type}")
6262

6363
template = "index.jinja" if is_index else "git.jinja"
64-
template_response = partial(TEMPLATES.TemplateResponse, name=template)
64+
template_response = partial(templates.TemplateResponse, name=template)
6565
max_file_size = log_slider_to_size(slider_position)
6666

6767
context = {

src/routers/dynamic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from fastapi import APIRouter, Form, Request
44
from fastapi.responses import HTMLResponse
55

6-
from config import TEMPLATES
6+
from config import templates
77
from query_processor import process_query
88
from server_utils import limiter
99

@@ -31,7 +31,7 @@ async def catch_all(request: Request, full_path: str) -> HTMLResponse:
3131
An HTML response containing the rendered template, with the Git URL
3232
and other default parameters such as loading state and file size.
3333
"""
34-
return TEMPLATES.TemplateResponse(
34+
return templates.TemplateResponse(
3535
"git.jinja",
3636
{
3737
"request": request,

src/routers/index.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from fastapi import APIRouter, Form, Request
44
from fastapi.responses import HTMLResponse
55

6-
from config import EXAMPLE_REPOS, TEMPLATES
6+
from config import EXAMPLE_REPOS, templates
77
from query_processor import process_query
88
from server_utils import limiter
99

@@ -29,7 +29,7 @@ async def home(request: Request) -> HTMLResponse:
2929
An HTML response containing the rendered home page template, with example repositories
3030
and other default parameters such as file size.
3131
"""
32-
return TEMPLATES.TemplateResponse(
32+
return templates.TemplateResponse(
3333
"index.jinja",
3434
{
3535
"request": request,

0 commit comments

Comments
 (0)