electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit 5e146b428c89b0926fc1f2b8ea10b4a0ab728af6
parent 535bef309eac0c89bf76b7fff602a1c92bc37cee
Author: ThomasV <thomasv1@gmx.de>
Date:   Tue, 12 Nov 2013 22:26:15 -0800

Merge pull request #405 from WyseNynja/flake8_setup

flake8 cleanup of ./setup*
Diffstat:
Msetup-release.py | 34+++++++++++++++++++---------------
Msetup.py | 147+++++++++++++++++++++++++++++++++++++++++--------------------------------------
2 files changed, 96 insertions(+), 85 deletions(-)

diff --git a/setup-release.py b/setup-release.py @@ -8,16 +8,20 @@ Usage (Windows): python setup.py py2exe """ -import sys, os, shutil, re from setuptools import setup -from lib.version import ELECTRUM_VERSION as version +import os +import re +import shutil +import sys + from lib.util import print_error +from lib.version import ELECTRUM_VERSION as version name = "Electrum" mainscript = 'electrum' -if sys.version_info[:3] < (2,6,0): +if sys.version_info[:3] < (2, 6, 0): print_error("Error: " + name + " requires Python version >= 2.6.0...") sys.exit(1) @@ -32,10 +36,10 @@ if sys.platform == 'darwin': setup_requires=['py2app'], app=[mainscript], options=dict(py2app=dict(argv_emulation=True, - includes = ['PyQt4.QtCore','PyQt4.QtGui', 'sip'], - packages = ['lib', 'gui', 'plugins'], + includes=['PyQt4.QtCore', 'PyQt4.QtGui', 'sip'], + packages=['lib', 'gui', 'plugins'], iconfile='electrum.icns', -# plist=plist, + #plist=plist, resources=["data", "icons"])), ) elif sys.platform == 'win32': @@ -51,8 +55,8 @@ else: ) setup( - name = name, - version = version, + name=name, + version=version, **extra_options ) from distutils import dir_util @@ -66,16 +70,16 @@ if sys.platform == 'darwin': # Try to locate qt_menu # Let's try the port version first! if os.path.isfile("/opt/local/lib/Resources/qt_menu.nib"): - qt_menu_location = "/opt/local/lib/Resources/qt_menu.nib" + qt_menu_location = "/opt/local/lib/Resources/qt_menu.nib" else: - # No dice? Then let's try the brew version - qt_menu_location = os.popen("find /usr/local/Cellar -name qt_menu.nib | tail -n 1").read() - qt_menu_location = re.sub('\n','', qt_menu_location) + # No dice? Then let's try the brew version + qt_menu_location = os.popen("find /usr/local/Cellar -name qt_menu.nib | tail -n 1").read() + qt_menu_location = re.sub('\n', '', qt_menu_location) - if(len(qt_menu_location) == 0): - print "Sorry couldn't find your qt_menu.nib this probably won't work" + if (len(qt_menu_location) == 0): + print "Sorry couldn't find your qt_menu.nib this probably won't work" else: - print "Found your qib: " + qt_menu_location + print "Found your qib: " + qt_menu_location # Need to include a copy of qt_menu.nib shutil.copytree(qt_menu_location, resource + "qt_menu.nib") diff --git a/setup.py b/setup.py @@ -3,31 +3,34 @@ # python setup.py sdist --format=zip,gztar from setuptools import setup -import os, sys, platform, imp +import os +import sys +import platform +import imp + version = imp.load_source('version', 'lib/version.py') util = imp.load_source('version', 'lib/util.py') -if sys.version_info[:3] < (2,6,0): +if sys.version_info[:3] < (2, 6, 0): sys.exit("Error: Electrum requires Python version >= 2.6.0...") usr_share = '/usr/share' if not os.access(usr_share, os.W_OK): - usr_share = os.getenv("XDG_DATA_HOME", - os.path.join(os.getenv("HOME"), ".local", "share")) + usr_share = os.getenv("XDG_DATA_HOME", os.path.join(os.getenv("HOME"), ".local", "share")) data_files = [] if (len(sys.argv) > 1 and (sys.argv[1] == "sdist")) or (platform.system() != 'Windows' and platform.system() != 'Darwin'): print "Including all files" data_files += [ - (os.path.join(usr_share, 'applications/'),['electrum.desktop']), - (os.path.join(usr_share, 'app-install', 'icons/'),['icons/electrum.png']) + (os.path.join(usr_share, 'applications/'), ['electrum.desktop']), + (os.path.join(usr_share, 'app-install', 'icons/'), ['icons/electrum.png']) ] if not os.path.exists('locale'): os.mkdir('locale') for lang in os.listdir('locale'): - if os.path.exists('locale/%s/LC_MESSAGES/electrum.mo'%lang): - data_files.append( (os.path.join(usr_share, 'locale/%s/LC_MESSAGES'%lang), ['locale/%s/LC_MESSAGES/electrum.mo'%lang]) ) + if os.path.exists('locale/%s/LC_MESSAGES/electrum.mo' % lang): + data_files.append((os.path.join(usr_share, 'locale/%s/LC_MESSAGES' % lang), ['locale/%s/LC_MESSAGES/electrum.mo' % lang])) data_files += [ (util.appdata_dir(), ["data/README"]), @@ -38,7 +41,7 @@ data_files += [ (os.path.join(util.appdata_dir(), "sahara"), [ "data/sahara/name.cfg", "data/sahara/style.css" - ]), + ]), (os.path.join(util.appdata_dir(), "dark"), [ "data/dark/background.png", "data/dark/name.cfg", @@ -47,65 +50,69 @@ data_files += [ ] -setup(name = "Electrum", - version = version.ELECTRUM_VERSION, - install_requires = ['slowaes','ecdsa>=0.9'], - package_dir = {'electrum': 'lib', 'electrum_gui': 'gui', 'electrum_plugins':'plugins'}, - scripts= ['electrum'], - data_files = data_files, - py_modules = ['electrum.account', - 'electrum.bitcoin', - 'electrum.blockchain', - 'electrum.commands', - 'electrum.interface', - 'electrum.mnemonic', - 'electrum.msqr', - 'electrum.network', - 'electrum.simple_config', - 'electrum.socks', - 'electrum.transaction', - 'electrum.util', - 'electrum.version', - 'electrum.verifier', - 'electrum.wallet', - 'electrum.wallet_bitkey', - 'electrum.wallet_factory', - 'electrum.bmp', - 'electrum.i18n', - 'electrum.pyqrnative', - 'electrum.plugins', - 'electrum_gui.gtk', - 'electrum_gui.text', - 'electrum_gui.qt.__init__', - 'electrum_gui.qt.amountedit', - 'electrum_gui.qt.console', - 'electrum_gui.qt.history_widget', - 'electrum_gui.qt.installwizard', - 'electrum_gui.qt.icons_rc', - 'electrum_gui.qt.lite_window', - 'electrum_gui.qt.main_window', - 'electrum_gui.qt.network_dialog', - 'electrum_gui.qt.password_dialog', - 'electrum_gui.qt.qrcodewidget', - 'electrum_gui.qt.receiving_widget', - 'electrum_gui.qt.seed_dialog', - 'electrum_gui.qt.transaction_dialog', - 'electrum_gui.qt.util', - 'electrum_gui.qt.version_getter', - 'electrum_gui.stdio', - 'electrum_plugins.aliases', - 'electrum_plugins.exchange_rate', - 'electrum_plugins.labels', - 'electrum_plugins.pointofsale', - 'electrum_plugins.qrscanner', - 'electrum_plugins.virtualkeyboard', - ], - description = "Lightweight Bitcoin Wallet", - author = "ecdsa", - author_email = "ecdsa@github", - license = "GNU GPLv3", - url = "http://electrum.org", - long_description = """Lightweight Bitcoin Wallet""" +setup( + name="Electrum", + version=version.ELECTRUM_VERSION, + install_requires=['slowaes', 'ecdsa>=0.9'], + package_dir={ + 'electrum': 'lib', + 'electrum_gui': 'gui', + 'electrum_plugins': 'plugins', + }, + scripts=['electrum'], + data_files=data_files, + py_modules=[ + 'electrum.account', + 'electrum.bitcoin', + 'electrum.blockchain', + 'electrum.bmp', + 'electrum.commands', + 'electrum.i18n', + 'electrum.interface', + 'electrum.mnemonic', + 'electrum.msqr', + 'electrum.network', + 'electrum.plugins', + 'electrum.pyqrnative', + 'electrum.simple_config', + 'electrum.socks', + 'electrum.transaction', + 'electrum.util', + 'electrum.verifier', + 'electrum.version', + 'electrum.wallet', + 'electrum.wallet_bitkey', + 'electrum.wallet_factory', + 'electrum_gui.gtk', + 'electrum_gui.qt.__init__', + 'electrum_gui.qt.amountedit', + 'electrum_gui.qt.console', + 'electrum_gui.qt.history_widget', + 'electrum_gui.qt.icons_rc', + 'electrum_gui.qt.installwizard', + 'electrum_gui.qt.lite_window', + 'electrum_gui.qt.main_window', + 'electrum_gui.qt.network_dialog', + 'electrum_gui.qt.password_dialog', + 'electrum_gui.qt.qrcodewidget', + 'electrum_gui.qt.receiving_widget', + 'electrum_gui.qt.seed_dialog', + 'electrum_gui.qt.transaction_dialog', + 'electrum_gui.qt.util', + 'electrum_gui.qt.version_getter', + 'electrum_gui.stdio', + 'electrum_gui.text', + 'electrum_plugins.aliases', + 'electrum_plugins.exchange_rate', + 'electrum_plugins.labels', + 'electrum_plugins.pointofsale', + 'electrum_plugins.qrscanner', + 'electrum_plugins.virtualkeyboard', + ], + description="Lightweight Bitcoin Wallet", + author="ecdsa", + author_email="ecdsa@github", + license="GNU GPLv3", + url="http://electrum.org", + long_description="""Lightweight Bitcoin Wallet""" ) - -