1
.gitignore
vendored
1
.gitignore
vendored
@@ -8,4 +8,3 @@ jsonrpc.egg-info/
|
|||||||
|
|
||||||
prototypes/
|
prototypes/
|
||||||
.tox/
|
.tox/
|
||||||
tests/
|
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ __email__ = 'remizoffalex@mail.ru'
|
|||||||
import json
|
import json
|
||||||
import jinja2
|
import jinja2
|
||||||
import logging
|
import logging
|
||||||
import pathlib
|
|
||||||
import aiohttp_jinja2
|
import aiohttp_jinja2
|
||||||
|
|
||||||
from aiohttp.web import Response
|
from aiohttp.web import Response
|
||||||
@@ -12,10 +11,10 @@ from aiohttp.web import Response
|
|||||||
from .. import JSONRPC
|
from .. import JSONRPC
|
||||||
from ..exceptions import ParseError
|
from ..exceptions import ParseError
|
||||||
from ..serialize import JSONRPCEncoder
|
from ..serialize import JSONRPCEncoder
|
||||||
|
from ..core import workdir
|
||||||
|
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
pathlib.Path(__file__).parent.resolve()
|
|
||||||
|
|
||||||
|
|
||||||
class APIHandler:
|
class APIHandler:
|
||||||
@@ -67,7 +66,7 @@ def api_init(app, jsonrpc: JSONRPC, rule: str = '/api'):
|
|||||||
app,
|
app,
|
||||||
enable_async=True,
|
enable_async=True,
|
||||||
loader=jinja2.FileSystemLoader(
|
loader=jinja2.FileSystemLoader(
|
||||||
pathlib.Path(__file__).parent.resolve() / 'templates'
|
workdir / 'templates'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
handler = APIHandler(jsonrpc)
|
handler = APIHandler(jsonrpc)
|
||||||
|
|||||||
6
src/jsonrpc/core.py
Normal file
6
src/jsonrpc/core.py
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
__author__ = 'RemiZOffAlex'
|
||||||
|
__email__ = 'remizoffalex@mail.ru'
|
||||||
|
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
workdir = Path(__file__).parent.resolve()
|
||||||
Reference in New Issue
Block a user