commit 1a781036cf0a3d04c5e170ef71fbf3e36c2ab908
parent a95e834e2e4410247933b0aea3d47f5fa3d9bd63
Author: thomasv <thomasv@gitorious>
Date: Fri, 12 Oct 2012 16:09:20 +0200
move init_socket in constructor
Diffstat:
6 files changed, 4 insertions(+), 10 deletions(-)
diff --git a/lib/interface.py b/lib/interface.py
@@ -60,8 +60,6 @@ class InterfaceAncestor(threading.Thread):
self.responses = Queue.Queue()
self.unanswered_requests = {}
- def init_socket(self):
- pass
def poke(self):
# push a fake response so that the getting thread exits its loop
@@ -210,6 +208,7 @@ class TcpStratumInterface(InterfaceAncestor):
def __init__(self, host, port, proxy=None):
InterfaceAncestor.__init__(self, host, port, proxy)
+ self.init_socket()
def init_socket(self):
global proxy_modes
@@ -435,7 +434,6 @@ class WalletSynchronizer(threading.Thread):
def start_interface(self):
- self.interface.init_socket()
self.interface.start()
if self.interface.is_connected:
self.wallet.start_session(self.interface)
diff --git a/scripts/blocks b/scripts/blocks
@@ -1,9 +1,9 @@
#!/usr/bin/env python
-from electrum import Interface
+import electrum
+
+i = electrum.Interface({'server':'electrum.novit.ro:50001:t'})
-i = Interface({'server':'electrum.novit.ro:50001:t'})
-i.init_socket()
i.start()
i.send([('blockchain.numblocks.subscribe',[])])
diff --git a/scripts/get_history b/scripts/get_history
@@ -10,7 +10,6 @@ except:
sys.exit(1)
i = Interface({'server':'electrum.novit.ro:50001:t'})
-i.init_socket()
i.start()
i.send([('blockchain.address.get_history',[addr])])
diff --git a/scripts/merchant.py b/scripts/merchant.py
@@ -158,7 +158,6 @@ if __name__ == '__main__':
conn = mdb.connect(db_instance, db_user, db_password, db_name);
i = Interface({'server':"%s:%d:t"%(electrum_server, 50001)})
- i.init_socket()
i.start()
diff --git a/scripts/peers b/scripts/peers
@@ -3,7 +3,6 @@
from electrum import Interface
i = Interface({'server':'electrum.novit.ro:50001:t'})
-i.init_socket()
i.start()
i.send([('server.peers.subscribe',[])])
diff --git a/scripts/watch_address b/scripts/watch_address
@@ -10,7 +10,6 @@ except:
sys.exit(1)
i = Interface({'server':'electrum.novit.ro:50001:t'})
-i.init_socket()
i.start()
i.send([('blockchain.address.subscribe',[addr])])