version management

This commit is contained in:
ThomasV 2011-12-09 21:01:53 +03:00
parent 008feaa768
commit d69b9ca2ec
5 changed files with 16 additions and 19 deletions

View File

@ -1,6 +1,2 @@
include client/README client/LICENCE
include server/README server/LICENCE
include server/electrum.php
recursive-include client *.py
recursive-include server *.py
recursive-include server/patches *
include README LICENCE RELEASE-NOTES
recursive-include *.py

View File

@ -33,7 +33,6 @@ except:
sys.exit(1)
############ functions from pywallet #####################
addrtype = 0
@ -216,17 +215,20 @@ class InvalidPassword(Exception):
WALLET_VERSION = 3 # bump this everytime the wallet format is modified
SEED_VERSION = 3 # bump this everytime the seed generation is modified
from version import ELECTRUM_VERSION
class Wallet:
def __init__(self, wallet_path):
self.electrum_version = ELECTRUM_VERSION
self.seed_version = SEED_VERSION
self.gap_limit = 5 # configuration
self.host = 'ecdsa.org'
self.port = 50000
self.fee = 50000
self.version = WALLET_VERSION
self.servers = ['ecdsa.org','electrum.novit.ro'] # list of default servers
# saved fields
@ -362,7 +364,7 @@ class Wallet:
return True
def save(self):
s = repr( (self.version, self.use_encryption, self.fee, self.host, self.port, self.blocks,
s = repr( (self.seed_version, self.use_encryption, self.fee, self.host, self.port, self.blocks,
self.seed, self.addresses, self.private_keys,
self.change_addresses, self.status, self.history,
self.labels, self.addressbook) )
@ -379,7 +381,7 @@ class Wallet:
return False
try:
sequence = ast.literal_eval( data )
(self.version, self.use_encryption, self.fee, self.host, self.port, self.blocks,
(self.seed_version, self.use_encryption, self.fee, self.host, self.port, self.blocks,
self.seed, self.addresses, self.private_keys,
self.change_addresses, self.status, self.history,
self.labels, self.addressbook) = sequence
@ -388,8 +390,8 @@ class Wallet:
# it is safer to exit immediately
print "Error; could not parse wallet."
exit(1)
if self.version != WALLET_VERSION:
raise BaseException("Wallet version error.\nPlease move your balance to a new wallet.\nSee the release notes for more information.")
if self.seed_version != SEED_VERSION:
raise BaseException("Seed version mismatch.\nPlease move your balance to a new wallet.\nSee the release notes for more information.")
self.update_tx_history()
return True

View File

@ -402,7 +402,7 @@ class BitcoinGUI:
self.period = 5
self.window = MyWindow(gtk.WINDOW_TOPLEVEL)
self.window.set_title(APP_NAME)
self.window.set_title(APP_NAME + " " + self.wallet.electrum_version)
self.window.connect("destroy", gtk.main_quit)
self.window.set_border_width(0)
self.window.connect('mykeypress', gtk.main_quit)

View File

@ -2,13 +2,11 @@
# python setup.py sdist --format=zip,gztar
from distutils.core import setup
version = "0.32"
from version import ELECTRUM_VERSION
setup(name = "Electrum",
version = version,
version = ELECTRUM_VERSION,
description = "Lightweight Bitcoin Wallet",
author = "thomasv",
license = "GNU GPLv3",

1
client/version.py Normal file
View File

@ -0,0 +1 @@
ELECTRUM_VERSION = "0.33"