svgui/pyjs/jsonrpc/web2py/jsonrpc.py
author Edouard Tisserant
Wed, 13 Nov 2019 11:21:04 +0100
branchsvghmi
changeset 2813 ac736a878188
parent 1881 091005ec69c4
permissions -rw-r--r--
Add FatalError() method to ConfigTreeNode.
Extensions can report error addressed to user, without a traceback.
1872
866fb3ab8778 fix pylint error "(undefined-variable) Undefined variable 'X'"
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1869
diff changeset
     1
# pylint: disable=undefined-variable
866fb3ab8778 fix pylint error "(undefined-variable) Undefined variable 'X'"
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1869
diff changeset
     2
1881
091005ec69c4 fix pylint py3k conversion warning: "(no-absolute-import) import missing `from __future__ import absolute_import`"
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1872
diff changeset
     3
from __future__ import absolute_import
1869
49cdd843c006 fix pylint error '(import-error) Unable to import X'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1748
diff changeset
     4
from svgui.pyjs.jsonrpc.jsonrpc import JSONRPCServiceBase
371
b7cb57a2da08 Adding new svgui support using twisted website HMI
laurent
parents:
diff changeset
     5
1736
7e61baa047f0 clean-up: fix PEP8 E302 expected 2 blank lines, found 1
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 728
diff changeset
     6
371
b7cb57a2da08 Adding new svgui support using twisted website HMI
laurent
parents:
diff changeset
     7
class JSONRPCService(JSONRPCServiceBase):
b7cb57a2da08 Adding new svgui support using twisted website HMI
laurent
parents:
diff changeset
     8
b7cb57a2da08 Adding new svgui support using twisted website HMI
laurent
parents:
diff changeset
     9
    def serve(self):
b7cb57a2da08 Adding new svgui support using twisted website HMI
laurent
parents:
diff changeset
    10
        return self.process(request.body.read())
b7cb57a2da08 Adding new svgui support using twisted website HMI
laurent
parents:
diff changeset
    11
1740
b789b695b5c6 clean-up: fix PEP8 E231 missing whitespace after ':' or ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1736
diff changeset
    12
    def __call__(self, func):
1742
92932cd370a4 clean-up: fix PEP8 E225 missing whitespace around operator
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1740
diff changeset
    13
        self.methods[func.__name__] = func
371
b7cb57a2da08 Adding new svgui support using twisted website HMI
laurent
parents:
diff changeset
    14
        return func