Update
Some checks failed
Test / Builder (push) Failing after 36s

This commit is contained in:
2026-01-14 13:45:11 +03:00
parent 79c1cb029d
commit 8f29893531
3 changed files with 8 additions and 4 deletions

1
.gitignore vendored
View File

@@ -8,4 +8,3 @@ jsonrpc.egg-info/
prototypes/
.tox/
tests/

View File

@@ -4,7 +4,6 @@ __email__ = 'remizoffalex@mail.ru'
import json
import jinja2
import logging
import pathlib
import aiohttp_jinja2
from aiohttp.web import Response
@@ -12,10 +11,10 @@ from aiohttp.web import Response
from .. import JSONRPC
from ..exceptions import ParseError
from ..serialize import JSONRPCEncoder
from ..core import workdir
log = logging.getLogger(__name__)
pathlib.Path(__file__).parent.resolve()
class APIHandler:
@@ -67,7 +66,7 @@ def api_init(app, jsonrpc: JSONRPC, rule: str = '/api'):
app,
enable_async=True,
loader=jinja2.FileSystemLoader(
pathlib.Path(__file__).parent.resolve() / 'templates'
workdir / 'templates'
)
)
handler = APIHandler(jsonrpc)

6
src/jsonrpc/core.py Normal file
View File

@@ -0,0 +1,6 @@
__author__ = 'RemiZOffAlex'
__email__ = 'remizoffalex@mail.ru'
from pathlib import Path
workdir = Path(__file__).parent.resolve()