python setup.py py2app Usage (Windows): python setup.py py2exe """ import sys, os, shutil, re from setuptools import setup from lib.version import ELECTRUM_VERSION as version from lib.util import print_error name = "Electrum" mainscript = 'electrum' if sys.version_info[:3] < (2, 6, 0): print_error("Error: " + name + " requires Python version >= 2.6.0...") sys.exit(1) if sys.platform == 'darwin': from plistlib import Plist plist = Plist.fromFile('Info.plist') plist.update(dict(CFBundleIconFile='electrum.icns')) shutil.copy(mainscript, mainscript + '.py') mainscript += '.py' extra_options = dict( setup_requires=['py2app'], app=[mainscript], options=dict( py2app=dict(argv_emulation=True, includes=['PyQt4.QtCore', 'PyQt4.QtGui', 'sip'],
Usage (Windows): python setup.py py2exe """ import sys, os, shutil, re from setuptools import setup from lib.version import ELECTRUM_VERSION as version from lib.util import print_error name = "Electrum" mainscript = 'electrum' if sys.version_info[:3] < (2,6,0): print_error("Error: " + name + " requires Python version >= 2.6.0...") sys.exit(1) if sys.platform == 'darwin': shutil.copy(mainscript, mainscript + '.py') mainscript += '.py' extra_options = dict( setup_requires=['py2app'], app=[mainscript], options=dict(py2app=dict(argv_emulation=True, includes = ['PyQt4.QtCore','PyQt4.QtGui', 'sip'], packages = ['lib', 'gui', 'plugins'], iconfile='electrum.icns', resources=["data", "icons"])), ) elif sys.platform == 'win32':
try: if cmd == 'new_wallet': out = server.new_wallet(arg) if cmd == 'getnum': out = server.getnum(arg) elif cmd == 'getkey': out = server.getkey(arg) elif cmd == 'getnewaddress': out = server.getnewaddress(arg) elif cmd == 'getbalance': out = server.getbalance(arg, addr) elif cmd == 'stop': out = server.stop() except socket.error: print_error("Server not running") sys.exit(1) print out sys.exit(0) else: # nw = get_wallet_or_create(master_public_key_hex) # nw.synchronize() # print nw.get_balance() wallet.set_path(wallet_path) wallet.read() def server_thread(): from SocketServer import ThreadingMixIn
#!/usr/bin/python # python setup.py sdist --format=zip,gztar from distutils.core import setup from lib.version import ELECTRUM_VERSION as version import lib.util as util import os, sys, platform from lib.util import print_error if sys.version_info[:3] < (2,6,0): print_error("Error: Electrum requires Python version >= 2.6.0...") sys.exit(1) data_files = [] if platform.system() != 'Windows' and platform.system() != 'Darwin': data_files += [ ('/usr/share/applications/',['electrum.desktop']), ('/usr/share/app-install/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( ('/usr/share/locale/%s/LC_MESSAGES'%lang, ['locale/%s/LC_MESSAGES/electrum.mo'%lang]) ) data_files += [ (util.appdata_dir(), ["data/background.png", "data/style.css"]), (os.path.join(util.appdata_dir(), "icons"), [
python setup.py py2app Usage (Windows): python setup.py py2exe """ from setuptools import setup import os import re import shutil import sys from lib.util import print_error from lib.version import ELECTRUM_VERSION as version print_error("setup-release.py is deprecated after Encompass-0.5.0") print_error("see contrib/encompass-release/build") name = "Encompass" mainscript = 'encompass' if sys.version_info[:3] < (2, 6, 0): print_error("Error: " + name + " requires Python version >= 2.6.0...") sys.exit(1) if sys.platform == 'darwin': from plistlib import Plist plist = Plist.fromFile('Info.plist') plist.update(dict(CFBundleIconFile='encompass.icns')) shutil.copy(mainscript, mainscript + '.py') mainscript += '.py'
Usage (Windows): python setup.py py2exe """ from setuptools import setup import os import re import shutil import sys from lib.util import print_error from lib.version import ELECTRUM_VERSION as version print_error("setup-release.py is deprecated after Encompass-0.5.0") print_error("see contrib/encompass-release/build") name = "Encompass" mainscript = 'encompass' if sys.version_info[:3] < (2, 6, 0): print_error("Error: " + name + " requires Python version >= 2.6.0...") sys.exit(1) if sys.platform == 'darwin': from plistlib import Plist plist = Plist.fromFile('Info.plist') plist.update(dict(CFBundleIconFile='encompass.icns')) shutil.copy(mainscript, mainscript + '.py') mainscript += '.py'
import jsonrpclib server = jsonrpclib.Server('http://%s:%s@%s:%d' % (username, password, host, port)) cmd = sys.argv[1] try: if cmd == 'getnum': out = server.getnum() elif cmd == 'getkey': out = server.getkey() elif cmd == 'getnewaddress': out = server.getnewaddress() elif cmd == 'stop': out = server.stop() except socket.error: print_error("Server not running") sys.exit(1) print out sys.exit(0) else: wallet.set_path(wallet_path) wallet.read() def server_thread(): from SocketServer import ThreadingMixIn from jsonrpclib.SimpleJSONRPCServer import SimpleJSONRPCServer server = SimpleJSONRPCServer((host, port), requestHandler=authHandler) server.register_function(get_new_address, 'getnewaddress')
""" from setuptools import setup import os import re import shutil import sys from lib.util import print_error from lib.version import PACKAGE_VERSION as version name = "OpenSwap" mainscript = 'openswap' if sys.version_info[:3] < (3, 5, 2): print_error("Error: " + name + " requires Python version >= 3.5.2...") sys.exit(1) if sys.platform == 'darwin': from plistlib import Plist plist = Plist.fromFile('Info.plist') plist.update(dict(CFBundleIconFile='electron.icns')) shutil.copy(mainscript, mainscript + '.py') mainscript += '.py' extra_options = dict( setup_requires=['py2app'], app=[mainscript], options=dict( py2app=dict(argv_emulation=False, includes=[
#!/usr/bin/python # python setup.py sdist --format=zip,gztar from distutils.core import setup from lib.version import ELECTRUM_VERSION as version import lib.util as util import os, sys, platform from lib.util import print_error if sys.version_info[:3] < (2, 6, 0): print_error("Error: Electrum requires Python version >= 2.6.0...") sys.exit(1) data_files = [] if platform.system() != 'Windows' and platform.system() != 'Darwin': data_files += [('/usr/share/applications/', ['electrum-bitcoin.desktop', 'electrum-litecoin.desktop']), ('/usr/share/app-install/icons/', ['electrum-bitcoin.png', 'electrum-litecoin.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(('/usr/share/locale/%s/LC_MESSAGES' % lang, ['locale/%s/LC_MESSAGES/electrum.mo' % lang])) data_files += [ (util.appdata_dir(), ["data/background.png", "data/style.css"]), (
if "HOME" in os.environ: wallet_dir = os.path.join( os.environ["HOME"], '.electrum') elif "LOCALAPPDATA" in os.environ: wallet_dir = os.path.join( os.environ["LOCALAPPDATA"], 'Electrum' ) elif "APPDATA" in os.environ: wallet_dir = os.path.join( os.environ["APPDATA"], 'Electrum' ) else: raise BaseException("No home directory found in environment variables.") path = os.path.join( wallet_dir, 'electrum.dat') try: f = open(path,"r") data = f.read() f.close() except: print_error("Error: File not found: " + path) exit(1) try: x = ast.literal_eval(data) except: print_error("Error: Could not parse wallet") exit(1) # version <= 0.33 uses a tuple if type(x) == tuple: seed_version, use_encryption, fee, host, port, blocks, seed, all_addresses, private_keys, change_indexes, status, history, labels, addressbook = x print "walet path =",path print "seed version =", seed_version
python setup.py py2app Usage (Windows): python setup.py py2exe """ import os, re, shutil, sys from setuptools import setup from lib.util import print_error from lib.version import ELECTRUM_VERSION as version from distutils import dir_util name = "Electrum-Woodcoin" mainscript = 'electrum-wdc' #wdc = woodcoin, if sys.version_info[:3] < (3, 0, 0): print_error("Error: " + name + " requires Python 3.0.0 or up") #Should probably require 3.4 sys.exit() if sys.platform == 'darwin': from plistlib import Plist plist = Plist.fromFile('Info.plist') plist.update(dict(CFBundleIconFile='electrum.icns')) # Woodcoin will need it's own icons shutil.copy(mainscript, mainscript + '.py') mainscript += '.py' extra_options = dict( setup_requires=['py2app'], app=[mainscript], options=dict(py2app=dict(argv_emulation=False, includes=['PyQt4.QtCore', 'PyQt4.QtGui', 'PyQt4.QtWebKit', 'PyQt4.QtNetwork', 'sip'], packages=['lib', 'gui', 'plugins', 'packages'],
wallet_dir = os.path.join(os.environ["HOME"], '.electrum') elif "LOCALAPPDATA" in os.environ: wallet_dir = os.path.join(os.environ["LOCALAPPDATA"], 'Electrum') elif "APPDATA" in os.environ: wallet_dir = os.path.join(os.environ["APPDATA"], 'Electrum') else: raise BaseException( "No home directory found in environment variables.") path = os.path.join(wallet_dir, 'electrum.dat') try: f = open(path, "r") data = f.read() f.close() except: print_error("Error: File not found: " + path) exit(1) try: x = ast.literal_eval(data) except: print_error("Error: Could not parse wallet") exit(1) # version <= 0.33 uses a tuple if type(x) == tuple: seed_version, use_encryption, fee, host, port, blocks, seed, all_addresses, private_keys, change_indexes, status, history, labels, addressbook = x print "walet path =", path print "seed version =", seed_version