DebugClients/Python3/DebugUtilities.py

branch
jsonrpc
changeset 5129
e4ab234cf071
parent 4631
5c1a96925da4
equal deleted inserted replaced
5128:b6cbdba69967 5129:e4ab234cf071
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

eric ide

mercurial