@@ -16,7 +16,7 @@ class Json_Rpc_Writer(object):
1616 Writes to the supplied stream through the JSON RPC Protocol where a request is formatted through a method
1717 name and the necessary parameters.
1818 """
19- HEADER = " Content-Length: {0}\r \n \r \n "
19+ HEADER = ' Content-Length: {0}\r \n \r \n '
2020
2121 def __init__ (self , stream , encoding = None ):
2222 self .stream = stream
@@ -30,10 +30,10 @@ def send_request(self, method, params, id = None):
3030 """
3131 # Perhaps move to a different def to add some validation
3232 content_body = {
33- " jsonrpc" : " 2.0" ,
34- " method" : method ,
35- " params" : params ,
36- "id" : id
33+ ' jsonrpc' : ' 2.0' ,
34+ ' method' : method ,
35+ ' params' : params ,
36+ 'id' : id
3737 }
3838
3939 json_content = json .dumps (content_body )
@@ -80,7 +80,7 @@ def read_response(self):
8080 if the body-content can not be serialized to a JSON object
8181 """
8282 # Using a mutable list to hold the value since a immutable string passed by reference won't change the value
83- content = ["" ]
83+ content = ['' ]
8484 while (self .read_next_chunk ()):
8585 # If we can't read a header, read the next chunk
8686 if (self .read_state is Read_State .Header and not self .try_read_headers ()):
@@ -162,7 +162,7 @@ def try_read_headers(self):
162162 colon_index = header .find (':' )
163163
164164 if (colon_index == - 1 ):
165- raise KeyError (" Colon missing from Header: {0}." .format (header ))
165+ raise KeyError (' Colon missing from Header: {0}.' .format (header ))
166166
167167 # Making all headers lowercase to support case insensitivity
168168 header_key = header [:colon_index ].lower ()
@@ -171,10 +171,10 @@ def try_read_headers(self):
171171 self .headers [header_key ] = header_value
172172
173173 #Find content body in the list of headers and parse the Value
174- if (not (" content-length" in self .headers )):
175- raise LookupError (" Content-Length was not found in headers received." )
174+ if (not (' content-length' in self .headers )):
175+ raise LookupError (' Content-Length was not found in headers received.' )
176176
177- self .expected_content_length = int (self .headers [" content-length" ])
177+ self .expected_content_length = int (self .headers [' content-length' ])
178178
179179 except ValueError :
180180 # Content-length contained invalid literal for int
0 commit comments