svgui/pyjs/jsonrpc/web2py/jsonrpc.py
author Andrey Skvortsov <andrej.skvortzov@gmail.com>
Thu, 21 Feb 2019 10:17:38 +0300
changeset 2512 69cef4e37ef9
parent 1881 091005ec69c4
permissions -rw-r--r--
Fix non-marking as manually forced floating point variable if the value isn't integer

For example, if user in debug variable panel set any floating point
variable to 34.3, then it's not shown as forced (blue color) and user
can't release this enforcement.

If user changes the value to 34.0, then enforcement shows
correctly. This is done because binary representation of floating point
numbers in IDE and runtime can be slightly different (double vs float)
and as a result values aren't equal.
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