diff options
author | muaddib1984 <70996692+muaddib1984@users.noreply.github.com> | 2021-10-25 06:51:52 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-25 06:51:52 -0400 |
commit | b8713810a2d07ac1a632bd7bfb23f3f48f67e222 (patch) | |
tree | 5278e1e97fab0c7da8c8cde899901dfeb3a54a6b /gr-blocks/grc | |
parent | cd9f9a0aa31252ab72e733a4d7b9a4a3d933fe96 (diff) |
blocks: Add XMLRPC examples
Signed-off-by: Paul Atreides <maud.dib1984@gmail.com>
Diffstat (limited to 'gr-blocks/grc')
-rw-r--r-- | gr-blocks/grc/xmlrpc_client.block.yml | 10 | ||||
-rw-r--r-- | gr-blocks/grc/xmlrpc_server.block.yml | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/gr-blocks/grc/xmlrpc_client.block.yml b/gr-blocks/grc/xmlrpc_client.block.yml index ba2d45eef2..56276c33c4 100644 --- a/gr-blocks/grc/xmlrpc_client.block.yml +++ b/gr-blocks/grc/xmlrpc_client.block.yml @@ -5,7 +5,7 @@ flags: [ python ] parameters: - id: addr label: Address - dtype: raw + dtype: string default: localhost - id: port label: Port @@ -13,7 +13,7 @@ parameters: default: '8080' - id: callback label: Callback - dtype: raw + dtype: string default: set_ - id: variable label: Variable @@ -21,11 +21,11 @@ parameters: templates: imports: from xmlrpc.client import ServerProxy - make: ServerProxy('http://${addr}:${port}') + make: ServerProxy('http://'+${addr}+':${port}') callbacks: - - ${callback}(${variable}) + - ${no_quotes(callback)}(${variable}) documentation: |- - This block will create an XMLRPC client. The client will execute the callback on the server when the variable is changed. The callback should be a the name of a function registered on the server. The variable should be an expression containing a the name of a variable in flow graph. + This block will create an XMLRPC client. The client will execute the callback on the server when the variable is changed. The callback should be the name of a function registered on the server. The variable should be an expression containing the name of a variable in the flowgraph. file_format: 1 diff --git a/gr-blocks/grc/xmlrpc_server.block.yml b/gr-blocks/grc/xmlrpc_server.block.yml index 8df1ae25c8..197cd829e1 100644 --- a/gr-blocks/grc/xmlrpc_server.block.yml +++ b/gr-blocks/grc/xmlrpc_server.block.yml @@ -28,8 +28,8 @@ documentation: |- Example client in python: - import xmlrpclib - s = xmlrpclib.Server('http://localhost:8080') + from xmlrpc.client import ServerProxy + ServerProxy('http://localhost:8080') s.set_freq(5000) file_format: 1 |