This commit is contained in:
2024-03-31 20:32:27 +03:00
parent ab33ba3763
commit fe25cd402c
5 changed files with 18 additions and 9 deletions

View File

@@ -5,16 +5,17 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to JSON-RPC's documentation!
====================================
Документация JSON-RPC!
======================
.. toctree::
:maxdepth: 2
:caption: Contents:
:caption: Содержание:
description
install
usage
backend/index
specification
Indices and tables

View File

@@ -6,7 +6,7 @@
.. code-block:: bash
./setup.py sdist
python -m build
Установка
---------

View File

@@ -1,6 +1,6 @@
[project]
name = "jsonrpc"
version = "0.3.2"
version = "1.0"
authors = [
{ name="RemiZOffAlex", email="remizoffalex@gmail.com" },
]
@@ -10,4 +10,12 @@ maintainers = [
description = ""
readme = "README.md"
requires-python = ">=3.10"
classifiers = [
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12"
]
keywords = ["api", "json", "json-rpc", "rpc"]

View File

@@ -36,8 +36,8 @@ class Method:
params = None
if 'params' in query:
params = query['params']
if self.debug:
log.error(params)
if self.debug:
log.error(params)
if isinstance(self.pre, list):
for item in self.pre:
item(query)

View File

@@ -34,7 +34,7 @@ class APIView(MethodView):
):
self.jsonrpc = jsonrpc
self.debug = debug
if debug:
if self.debug:
log.debug('Connect JSON-RPC to Flask complete')
def get(self):
@@ -45,6 +45,6 @@ class APIView(MethodView):
def post(self):
json_data = to_json(request.data)
result = self.jsonrpc(json_data)
if debug:
if self.debug:
log.debug(result)
return jsonify(result)