Browse Source

cosmetic change

283
thomasv 13 years ago
parent
commit
1f0d52dd52
  1. 8
      client/electrum.py

8
client/electrum.py

@ -228,14 +228,14 @@ class Interface:
def set_port(self, port_number): def set_port(self, port_number):
self.port = port_number self.port = port_number
if self.use_http(): if self.use_http():
self.handler = self.http_json_request self.handler = self.http_json_handler
else: else:
self.handler = self.native_request self.handler = self.native_handler
def use_http(self): def use_http(self):
return self.port in [80,81,8080,8081] return self.port in [80,81,8080,8081]
def native_request(self, method, params = ''): def native_handler(self, method, params = ''):
import time import time
cmds = {'session.new':'new_session', cmds = {'session.new':'new_session',
'peers':'peers', 'peers':'peers',
@ -262,7 +262,7 @@ class Interface:
out = ast.literal_eval( out ) out = ast.literal_eval( out )
return out return out
def http_json_request(self, method, params = []): def http_json_handler(self, method, params = []):
import urllib2, json, time import urllib2, json, time
if type(params) != type([]): params = [ params ] if type(params) != type([]): params = [ params ]
t1 = time.time() t1 = time.time()

Loading…
Cancel
Save