Browse Source

setup package in lib subdirectory

master
thomasv 14 years ago
parent
commit
b8773178a1
  1. 1
      MANIFEST.in
  2. 21
      README
  3. 4
      blocks
  4. 10
      electrum
  5. 3
      lib/__init__.py
  6. 0
      lib/bmp.py
  7. 6
      lib/gui.py
  8. 8
      lib/gui_qt.py
  9. 0
      lib/interface.py
  10. 0
      lib/mnemonic.py
  11. 0
      lib/msqr.py
  12. 0
      lib/pyqrnative.py
  13. 0
      lib/ripemd.py
  14. 2
      lib/version.py
  15. 0
      lib/wallet.py
  16. 4
      peers
  17. 7
      setup.py
  18. 6
      watch_address

1
MANIFEST.in

@ -2,6 +2,7 @@ include README LICENCE RELEASE-NOTES
include *.py include *.py
include electrum include electrum
exclude setup.py exclude setup.py
recursive-include lib *.py
recursive-include ecdsa *.py recursive-include ecdsa *.py
recursive-include aes *.py recursive-include aes *.py
include icons.qrc include icons.qrc

21
README

@ -30,17 +30,22 @@ In order to use the gtk gui, you need pygtk and tk.
* apt-get install python-tk * apt-get install python-tk
To install Electrum, type:
sudo python setup.py install
RUN RUN
To start the Qt gui, type: To start Electrum in GUI mode, type:
python electrum
To use the Gtk gui, type: electrum
python electrum --gui gtk
If arguments are passed to the command line, Electrum will run in text mode:
If arguments are passed to the command line, Electrum will run in text mode. electrum balance
Examples: electrum help
python electrum balance
python electrum help

4
blocks

@ -1,8 +1,8 @@
#!/usr/bin/env python #!/usr/bin/env python
import interface from electrum import TcpStratumInterface
i = interface.TcpStratumInterface('ecdsa.org', 50001) i = TcpStratumInterface('ecdsa.org', 50001)
i.start() i.start()
i.send([('blockchain.numblocks.subscribe',[])]) i.send([('blockchain.numblocks.subscribe',[])])

10
electrum

@ -18,11 +18,11 @@
import re, sys, getpass import re, sys, getpass
import electrum
from optparse import OptionParser from optparse import OptionParser
from wallet import Wallet, SecretToASecret
from interface import WalletSynchronizer
from decimal import Decimal from decimal import Decimal
from wallet import format_satoshis
from electrum import Wallet, SecretToASecret, WalletSynchronizer, format_satoshis
known_commands = ['help', 'validateaddress', 'balance', 'contacts', 'create', 'restore', 'payto', 'sendtx', 'password', 'addresses', 'history', 'label', 'mktx','seed','import','signmessage','verifymessage','eval'] known_commands = ['help', 'validateaddress', 'balance', 'contacts', 'create', 'restore', 'payto', 'sendtx', 'password', 'addresses', 'history', 'label', 'mktx','seed','import','signmessage','verifymessage','eval']
offline_commands = ['password', 'mktx', 'history', 'label', 'contacts', 'help', 'validateaddress', 'signmessage', 'verifymessage', 'eval', 'create', 'addresses', 'import', 'seed'] offline_commands = ['password', 'mktx', 'history', 'label', 'contacts', 'help', 'validateaddress', 'signmessage', 'verifymessage', 'eval', 'create', 'addresses', 'import', 'seed']
@ -60,9 +60,9 @@ if __name__ == '__main__':
if cmd == 'gui': if cmd == 'gui':
if options.gui=='gtk': if options.gui=='gtk':
import gui import electrum.gui as gui
elif options.gui=='qt': elif options.gui=='qt':
import gui_qt as gui import electrum.gui_qt as gui
else: else:
print "unknown gui", options.gui print "unknown gui", options.gui
exit(1) exit(1)

3
lib/__init__.py

@ -0,0 +1,3 @@
from wallet import Wallet, SecretToASecret, format_satoshis
from interface import WalletSynchronizer
from interface import TcpStratumInterface

0
bmp.py → lib/bmp.py

6
gui.py → lib/gui.py

@ -22,7 +22,7 @@ import socket, traceback
import pygtk import pygtk
pygtk.require('2.0') pygtk.require('2.0')
import gtk, gobject import gtk, gobject
import pyqrnative from electrum import pyqrnative
from decimal import Decimal from decimal import Decimal
gtk.gdk.threads_init() gtk.gdk.threads_init()
@ -59,7 +59,7 @@ def numbify(entry, is_int = False):
def show_seed_dialog(wallet, password, parent): def show_seed_dialog(wallet, password, parent):
import mnemonic from electrum import mnemonic
try: try:
seed = wallet.pw_decode( wallet.seed, password) seed = wallet.pw_decode( wallet.seed, password)
except: except:
@ -203,7 +203,7 @@ def run_recovery_dialog(wallet):
try: try:
seed.decode('hex') seed.decode('hex')
except: except:
import mnemonic from electrum import mnemonic
print "not hex, trying decode" print "not hex, trying decode"
seed = mnemonic.mn_decode( seed.split(' ') ) seed = mnemonic.mn_decode( seed.split(' ') )
if not seed: if not seed:

8
gui_qt.py → lib/gui_qt.py

@ -101,7 +101,7 @@ class QRCodeWidget(QWidget):
self.set_addr(addr) self.set_addr(addr)
def set_addr(self, addr): def set_addr(self, addr):
import pyqrnative from electrum import pyqrnative
self.addr = addr self.addr = addr
self.qr = pyqrnative.QRCode(4, pyqrnative.QRErrorCorrectLevel.L) self.qr = pyqrnative.QRCode(4, pyqrnative.QRErrorCorrectLevel.L)
self.qr.addData(addr) self.qr.addData(addr)
@ -688,7 +688,7 @@ class ElectrumWindow(QMainWindow):
@staticmethod @staticmethod
def show_seed_dialog(wallet, parent=None): def show_seed_dialog(wallet, parent=None):
import mnemonic from electrum import mnemonic
if wallet.use_encryption: if wallet.use_encryption:
password = parent.password_dialog() password = parent.password_dialog()
if not password: return if not password: return
@ -796,7 +796,7 @@ class ElectrumWindow(QMainWindow):
qrw.repaint() qrw.repaint()
def do_save(): def do_save():
import bmp from electrum import bmp
bmp.save_qrcode(qrw.qr, "qrcode.bmp") bmp.save_qrcode(qrw.qr, "qrcode.bmp")
self.show_message("QR code saved to file 'qrcode.bmp'") self.show_message("QR code saved to file 'qrcode.bmp'")
@ -936,7 +936,7 @@ class ElectrumWindow(QMainWindow):
seed = unicode(seed_e.text()) seed = unicode(seed_e.text())
seed.decode('hex') seed.decode('hex')
except: except:
import mnemonic from electrum import mnemonic
print "not hex, trying decode" print "not hex, trying decode"
try: try:
seed = mnemonic.mn_decode( seed.split(' ') ) seed = mnemonic.mn_decode( seed.split(' ') )

0
interface.py → lib/interface.py

0
mnemonic.py → lib/mnemonic.py

0
msqr.py → lib/msqr.py

0
pyqrnative.py → lib/pyqrnative.py

0
ripemd.py → lib/ripemd.py

2
version.py → lib/version.py

@ -1,2 +1,2 @@
ELECTRUM_VERSION = "0.47b" ELECTRUM_VERSION = "0.48"
SEED_VERSION = 4 # bump this everytime the seed generation is modified SEED_VERSION = 4 # bump this everytime the seed generation is modified

0
wallet.py → lib/wallet.py

4
peers

@ -1,8 +1,8 @@
#!/usr/bin/env python #!/usr/bin/env python
import interface from electrum import TcpStratumInterface
i = interface.TcpStratumInterface('ecdsa.org', 50001) i = TcpStratumInterface('ecdsa.org', 50001)
i.start() i.start()
i.send([('server.peers.subscribe',[])]) i.send([('server.peers.subscribe',[])])

7
setup.py

@ -3,15 +3,18 @@
# python setup.py sdist --format=zip,gztar # python setup.py sdist --format=zip,gztar
from distutils.core import setup from distutils.core import setup
from version import ELECTRUM_VERSION as version from lib.version import ELECTRUM_VERSION as version
setup(name = "Electrum", setup(name = "Electrum",
version = version, version = version,
package_dir = {'electrum': 'lib'},
scripts= ['electrum', 'watch_address', 'blocks'],
py_modules = ['electrum.version','electrum.wallet','electrum.interface','electrum.gui','electrum.gui_qt','electrum.icons_rc','electrum.mnemonic','electrum.pyqrnative','electrum.bmp'],
description = "Lightweight Bitcoin Wallet", description = "Lightweight Bitcoin Wallet",
author = "thomasv", author = "thomasv",
license = "GNU GPLv3", license = "GNU GPLv3",
url = "http://ecdsa/electrum", url = "http://ecdsa/electrum",
long_description = """Lightweight Bitcoin Wallet""" long_description = """Lightweight Bitcoin Wallet"""
) )

6
watch_address

@ -1,12 +1,14 @@
#!/usr/bin/env python #!/usr/bin/env python
import interface, sys import sys
from electrum import TcpStratumInterface
try: try:
addr = sys.argv[1] addr = sys.argv[1]
except: except:
print "usage: watch_address <bitcoin_address>" print "usage: watch_address <bitcoin_address>"
i = interface.TcpStratumInterface('ecdsa.org', 50001) i = TcpStratumInterface('ecdsa.org', 50001)
i.start() i.start()
i.send([('blockchain.address.subscribe',[addr])]) i.send([('blockchain.address.subscribe',[addr])])

Loading…
Cancel
Save