121 argvalues = '(' + ', '.join(specs) + ')' |
121 argvalues = '(' + ', '.join(specs) + ')' |
122 if '__return__' in locals: |
122 if '__return__' in locals: |
123 argvalues += " -> " + formatvalue(locals['__return__']) |
123 argvalues += " -> " + formatvalue(locals['__return__']) |
124 return argvalues |
124 return argvalues |
125 |
125 |
|
126 |
|
127 def prepareJsonCommand(method, params): |
|
128 """ |
|
129 Function to prepare a single command or response for transmission to |
|
130 the IDE. |
|
131 |
|
132 @param method command or response name to be sent |
|
133 @type str |
|
134 @param params dictionary of named parameters for the command or response |
|
135 @type dict |
|
136 @return prepared JSON command or response string |
|
137 @rtype str |
|
138 """ |
|
139 import json |
|
140 |
|
141 commandDict = { |
|
142 "jsonrpc": "2.0", |
|
143 "method": method, |
|
144 "params": params, |
|
145 } |
|
146 return json.dumps(commandDict) + '\n' |
|
147 |
126 # |
148 # |
127 # eflag: noqa = M702 |
149 # eflag: noqa = M702 |