file reorganization with top-level module
3
.gitignore
vendored
|
@ -4,10 +4,9 @@
|
|||
build/
|
||||
dist/
|
||||
*.egg/
|
||||
/electrum.py
|
||||
contrib/pyinstaller/
|
||||
Electrum.egg-info/
|
||||
gui/qt/icons_rc.py
|
||||
electrum/gui/qt/icons_rc.py
|
||||
locale/
|
||||
.devlocaltmp/
|
||||
*_trial_temp
|
||||
|
|
|
@ -36,7 +36,7 @@ Electrum from its root directory, without installing it on your
|
|||
system; all the python dependencies are included in the 'packages'
|
||||
directory. To run Electrum from its root directory, just do::
|
||||
|
||||
./electrum
|
||||
./run_electrum
|
||||
|
||||
You can also install Electrum on your system, by running this command::
|
||||
|
||||
|
@ -73,12 +73,12 @@ Render the SVG icons to PNGs (optional)::
|
|||
Compile the icons file for Qt::
|
||||
|
||||
sudo apt-get install pyqt5-dev-tools
|
||||
pyrcc5 icons.qrc -o gui/qt/icons_rc.py
|
||||
pyrcc5 icons.qrc -o electrum/gui/qt/icons_rc.py
|
||||
|
||||
Compile the protobuf description file::
|
||||
|
||||
sudo apt-get install protobuf-compiler
|
||||
protoc --proto_path=lib/ --python_out=lib/ lib/paymentrequest.proto
|
||||
protoc --proto_path=electrum --python_out=electrum electrum/paymentrequest.proto
|
||||
|
||||
Create translations (optional)::
|
||||
|
||||
|
|
|
@ -46,8 +46,8 @@ git submodule update
|
|||
rm -rf $BUILDDIR > /dev/null 2>&1
|
||||
mkdir $BUILDDIR
|
||||
|
||||
cp -R ./contrib/deterministic-build/electrum-locale/locale/ ./lib/locale/
|
||||
cp ./contrib/deterministic-build/electrum-icons/icons_rc.py ./gui/qt/
|
||||
cp -R ./contrib/deterministic-build/electrum-locale/locale/ ./electrum/locale/
|
||||
cp ./contrib/deterministic-build/electrum-icons/icons_rc.py ./electrum/gui/qt/
|
||||
|
||||
|
||||
info "Downloading libusb..."
|
||||
|
|
|
@ -1,97 +1,96 @@
|
|||
# -*- mode: python -*-
|
||||
|
||||
from PyInstaller.utils.hooks import collect_data_files, collect_submodules, collect_dynamic_libs
|
||||
|
||||
import sys
|
||||
import os
|
||||
|
||||
PACKAGE='Electrum'
|
||||
PYPKG='electrum'
|
||||
MAIN_SCRIPT='electrum'
|
||||
ICONS_FILE='electrum.icns'
|
||||
|
||||
for i, x in enumerate(sys.argv):
|
||||
if x == '--name':
|
||||
VERSION = sys.argv[i+1]
|
||||
break
|
||||
else:
|
||||
raise Exception('no version')
|
||||
|
||||
electrum = os.path.abspath(".") + "/"
|
||||
block_cipher = None
|
||||
|
||||
# see https://github.com/pyinstaller/pyinstaller/issues/2005
|
||||
hiddenimports = []
|
||||
hiddenimports += collect_submodules('trezorlib')
|
||||
hiddenimports += collect_submodules('btchip')
|
||||
hiddenimports += collect_submodules('keepkeylib')
|
||||
hiddenimports += collect_submodules('websocket')
|
||||
|
||||
datas = [
|
||||
(electrum+'lib/*.json', PYPKG),
|
||||
(electrum+'lib/wordlist/english.txt', PYPKG + '/wordlist'),
|
||||
(electrum+'lib/locale', PYPKG + '/locale'),
|
||||
(electrum+'plugins', PYPKG + '_plugins'),
|
||||
]
|
||||
datas += collect_data_files('trezorlib')
|
||||
datas += collect_data_files('btchip')
|
||||
datas += collect_data_files('keepkeylib')
|
||||
|
||||
# Add libusb so Trezor will work
|
||||
binaries = [(electrum + "contrib/build-osx/libusb-1.0.dylib", ".")]
|
||||
binaries += [(electrum + "contrib/build-osx/libsecp256k1.0.dylib", ".")]
|
||||
|
||||
# Workaround for "Retro Look":
|
||||
binaries += [b for b in collect_dynamic_libs('PyQt5') if 'macstyle' in b[0]]
|
||||
|
||||
# We don't put these files in to actually include them in the script but to make the Analysis method scan them for imports
|
||||
a = Analysis([electrum+MAIN_SCRIPT,
|
||||
electrum+'gui/qt/main_window.py',
|
||||
electrum+'gui/text.py',
|
||||
electrum+'lib/util.py',
|
||||
electrum+'lib/wallet.py',
|
||||
electrum+'lib/simple_config.py',
|
||||
electrum+'lib/bitcoin.py',
|
||||
electrum+'lib/dnssec.py',
|
||||
electrum+'lib/commands.py',
|
||||
electrum+'plugins/cosigner_pool/qt.py',
|
||||
electrum+'plugins/email_requests/qt.py',
|
||||
electrum+'plugins/trezor/client.py',
|
||||
electrum+'plugins/trezor/qt.py',
|
||||
electrum+'plugins/keepkey/qt.py',
|
||||
electrum+'plugins/ledger/qt.py',
|
||||
],
|
||||
binaries=binaries,
|
||||
datas=datas,
|
||||
hiddenimports=hiddenimports,
|
||||
hookspath=[])
|
||||
|
||||
# http://stackoverflow.com/questions/19055089/pyinstaller-onefile-warning-pyconfig-h-when-importing-scipy-or-scipy-signal
|
||||
for d in a.datas:
|
||||
if 'pyconfig' in d[0]:
|
||||
a.datas.remove(d)
|
||||
break
|
||||
|
||||
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
|
||||
|
||||
exe = EXE(pyz,
|
||||
a.scripts,
|
||||
a.binaries,
|
||||
a.datas,
|
||||
name=PACKAGE,
|
||||
debug=False,
|
||||
strip=False,
|
||||
upx=True,
|
||||
icon=electrum+ICONS_FILE,
|
||||
console=False)
|
||||
|
||||
app = BUNDLE(exe,
|
||||
version = VERSION,
|
||||
name=PACKAGE + '.app',
|
||||
icon=electrum+ICONS_FILE,
|
||||
bundle_identifier=None,
|
||||
info_plist={
|
||||
'NSHighResolutionCapable': 'True',
|
||||
'NSSupportsAutomaticGraphicsSwitching': 'True'
|
||||
}
|
||||
)
|
||||
# -*- mode: python -*-
|
||||
|
||||
from PyInstaller.utils.hooks import collect_data_files, collect_submodules, collect_dynamic_libs
|
||||
|
||||
import sys
|
||||
import os
|
||||
|
||||
PACKAGE='Electrum'
|
||||
PYPKG='electrum'
|
||||
MAIN_SCRIPT='run_electrum'
|
||||
ICONS_FILE='electrum.icns'
|
||||
|
||||
for i, x in enumerate(sys.argv):
|
||||
if x == '--name':
|
||||
VERSION = sys.argv[i+1]
|
||||
break
|
||||
else:
|
||||
raise Exception('no version')
|
||||
|
||||
electrum = os.path.abspath(".") + "/"
|
||||
block_cipher = None
|
||||
|
||||
# see https://github.com/pyinstaller/pyinstaller/issues/2005
|
||||
hiddenimports = []
|
||||
hiddenimports += collect_submodules('trezorlib')
|
||||
hiddenimports += collect_submodules('btchip')
|
||||
hiddenimports += collect_submodules('keepkeylib')
|
||||
hiddenimports += collect_submodules('websocket')
|
||||
|
||||
datas = [
|
||||
(electrum+'electrum/*.json', PYPKG),
|
||||
(electrum+'electrum/wordlist/english.txt', PYPKG + '/wordlist'),
|
||||
(electrum+'electrum/locale', PYPKG + '/locale')
|
||||
]
|
||||
datas += collect_data_files('trezorlib')
|
||||
datas += collect_data_files('btchip')
|
||||
datas += collect_data_files('keepkeylib')
|
||||
|
||||
# Add libusb so Trezor will work
|
||||
binaries = [(electrum + "contrib/build-osx/libusb-1.0.dylib", ".")]
|
||||
binaries += [(electrum + "contrib/build-osx/libsecp256k1.0.dylib", ".")]
|
||||
|
||||
# Workaround for "Retro Look":
|
||||
binaries += [b for b in collect_dynamic_libs('PyQt5') if 'macstyle' in b[0]]
|
||||
|
||||
# We don't put these files in to actually include them in the script but to make the Analysis method scan them for imports
|
||||
a = Analysis([electrum+ MAIN_SCRIPT,
|
||||
electrum+'electrum/gui/qt/main_window.py',
|
||||
electrum+'electrum/gui/text.py',
|
||||
electrum+'electrum/util.py',
|
||||
electrum+'electrum/wallet.py',
|
||||
electrum+'electrum/simple_config.py',
|
||||
electrum+'electrum/bitcoin.py',
|
||||
electrum+'electrum/dnssec.py',
|
||||
electrum+'electrum/commands.py',
|
||||
electrum+'electrum/plugins/cosigner_pool/qt.py',
|
||||
electrum+'electrum/plugins/email_requests/qt.py',
|
||||
electrum+'electrum/plugins/trezor/client.py',
|
||||
electrum+'electrum/plugins/trezor/qt.py',
|
||||
electrum+'electrum/plugins/keepkey/qt.py',
|
||||
electrum+'electrum/plugins/ledger/qt.py',
|
||||
],
|
||||
binaries=binaries,
|
||||
datas=datas,
|
||||
hiddenimports=hiddenimports,
|
||||
hookspath=[])
|
||||
|
||||
# http://stackoverflow.com/questions/19055089/pyinstaller-onefile-warning-pyconfig-h-when-importing-scipy-or-scipy-signal
|
||||
for d in a.datas:
|
||||
if 'pyconfig' in d[0]:
|
||||
a.datas.remove(d)
|
||||
break
|
||||
|
||||
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
|
||||
|
||||
exe = EXE(pyz,
|
||||
a.scripts,
|
||||
a.binaries,
|
||||
a.datas,
|
||||
name=PACKAGE,
|
||||
debug=False,
|
||||
strip=False,
|
||||
upx=True,
|
||||
icon=electrum+ICONS_FILE,
|
||||
console=False)
|
||||
|
||||
app = BUNDLE(exe,
|
||||
version = VERSION,
|
||||
name=PACKAGE + '.app',
|
||||
icon=electrum+ICONS_FILE,
|
||||
bundle_identifier=None,
|
||||
info_plist={
|
||||
'NSHighResolutionCapable': 'True',
|
||||
'NSSupportsAutomaticGraphicsSwitching': 'True'
|
||||
}
|
||||
)
|
||||
|
|
|
@ -62,8 +62,8 @@ popd
|
|||
rm -rf $WINEPREFIX/drive_c/electrum
|
||||
cp -r electrum $WINEPREFIX/drive_c/electrum
|
||||
cp electrum/LICENCE .
|
||||
cp -r ./electrum/contrib/deterministic-build/electrum-locale/locale $WINEPREFIX/drive_c/electrum/lib/
|
||||
cp ./electrum/contrib/deterministic-build/electrum-icons/icons_rc.py $WINEPREFIX/drive_c/electrum/gui/qt/
|
||||
cp -r ./electrum/contrib/deterministic-build/electrum-locale/locale $WINEPREFIX/drive_c/electrum/electrum/
|
||||
cp ./electrum/contrib/deterministic-build/electrum-icons/icons_rc.py $WINEPREFIX/drive_c/electrum/electrum/gui/qt/
|
||||
|
||||
# Install frozen dependencies
|
||||
$PYTHON -m pip install -r ../../deterministic-build/requirements.txt
|
||||
|
|
|
@ -31,10 +31,9 @@ binaries += [b for b in collect_dynamic_libs('PyQt5') if 'qwindowsvista' in b[0]
|
|||
binaries += [('C:/tmp/libsecp256k1.dll', '.')]
|
||||
|
||||
datas = [
|
||||
(home+'lib/*.json', 'electrum'),
|
||||
(home+'lib/wordlist/english.txt', 'electrum/wordlist'),
|
||||
(home+'lib/locale', 'electrum/locale'),
|
||||
(home+'plugins', 'electrum_plugins'),
|
||||
(home+'electrum/*.json', 'electrum'),
|
||||
(home+'electrum/wordlist/english.txt', 'electrum/wordlist'),
|
||||
(home+'electrum/locale', 'electrum/locale'),
|
||||
('C:\\Program Files (x86)\\ZBar\\bin\\', '.')
|
||||
]
|
||||
datas += collect_data_files('trezorlib')
|
||||
|
@ -42,21 +41,21 @@ datas += collect_data_files('btchip')
|
|||
datas += collect_data_files('keepkeylib')
|
||||
|
||||
# We don't put these files in to actually include them in the script but to make the Analysis method scan them for imports
|
||||
a = Analysis([home+'electrum',
|
||||
home+'gui/qt/main_window.py',
|
||||
home+'gui/text.py',
|
||||
home+'lib/util.py',
|
||||
home+'lib/wallet.py',
|
||||
home+'lib/simple_config.py',
|
||||
home+'lib/bitcoin.py',
|
||||
home+'lib/dnssec.py',
|
||||
home+'lib/commands.py',
|
||||
home+'plugins/cosigner_pool/qt.py',
|
||||
home+'plugins/email_requests/qt.py',
|
||||
home+'plugins/trezor/client.py',
|
||||
home+'plugins/trezor/qt.py',
|
||||
home+'plugins/keepkey/qt.py',
|
||||
home+'plugins/ledger/qt.py',
|
||||
a = Analysis([home+'run_electrum',
|
||||
home+'electrum/gui/qt/main_window.py',
|
||||
home+'electrum/gui/text.py',
|
||||
home+'electrum/util.py',
|
||||
home+'electrum/wallet.py',
|
||||
home+'electrum/simple_config.py',
|
||||
home+'electrum/bitcoin.py',
|
||||
home+'electrum/dnssec.py',
|
||||
home+'electrum/commands.py',
|
||||
home+'electrum/plugins/cosigner_pool/qt.py',
|
||||
home+'electrum/plugins/email_requests/qt.py',
|
||||
home+'electrum/plugins/trezor/client.py',
|
||||
home+'electrum/plugins/trezor/qt.py',
|
||||
home+'electrum/plugins/keepkey/qt.py',
|
||||
home+'electrum/plugins/ledger/qt.py',
|
||||
#home+'packages/requests/utils.py'
|
||||
],
|
||||
binaries=binaries,
|
||||
|
@ -68,7 +67,7 @@ a = Analysis([home+'electrum',
|
|||
|
||||
# http://stackoverflow.com/questions/19055089/pyinstaller-onefile-warning-pyconfig-h-when-importing-scipy-or-scipy-signal
|
||||
for d in a.datas:
|
||||
if 'pyconfig' in d[0]:
|
||||
if 'pyconfig' in d[0]:
|
||||
a.datas.remove(d)
|
||||
break
|
||||
|
||||
|
@ -85,7 +84,7 @@ exe_standalone = EXE(
|
|||
pyz,
|
||||
a.scripts,
|
||||
a.binaries,
|
||||
a.datas,
|
||||
a.datas,
|
||||
name=os.path.join('build\\pyi.win32\\electrum', cmdline_name + ".exe"),
|
||||
debug=False,
|
||||
strip=None,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
pushd ./gui/kivy/
|
||||
pushd ./electrum/gui/kivy/
|
||||
|
||||
if [[ -n "$1" && "$1" == "release" ]] ; then
|
||||
echo -n Keystore Password:
|
||||
|
|
|
@ -8,8 +8,7 @@ import requests
|
|||
os.chdir(os.path.dirname(os.path.realpath(__file__)))
|
||||
os.chdir('..')
|
||||
|
||||
code_directories = 'gui plugins lib'
|
||||
cmd = "find {} -type f -name '*.py' -o -name '*.kv'".format(code_directories)
|
||||
cmd = "find electrum -type f -name '*.py' -o -name '*.kv'"
|
||||
|
||||
files = subprocess.check_output(cmd, shell=True)
|
||||
|
||||
|
@ -19,13 +18,13 @@ with open("app.fil", "wb") as f:
|
|||
print("Found {} files to translate".format(len(files.splitlines())))
|
||||
|
||||
# Generate fresh translation template
|
||||
if not os.path.exists('lib/locale'):
|
||||
os.mkdir('lib/locale')
|
||||
cmd = 'xgettext -s --from-code UTF-8 --language Python --no-wrap -f app.fil --output=lib/locale/messages.pot'
|
||||
if not os.path.exists('electrum/locale'):
|
||||
os.mkdir('electrum/locale')
|
||||
cmd = 'xgettext -s --from-code UTF-8 --language Python --no-wrap -f app.fil --output=electrum/locale/messages.pot'
|
||||
print('Generate template')
|
||||
os.system(cmd)
|
||||
|
||||
os.chdir('lib')
|
||||
os.chdir('electrum')
|
||||
|
||||
crowdin_identifier = 'electrum'
|
||||
crowdin_file_name = 'files[electrum-client/messages.pot]'
|
||||
|
|
|
@ -22,6 +22,6 @@ fi
|
|||
|
||||
export PYTHONPATH="/usr/local/lib/python${PYTHON_VER}/site-packages:$PYTHONPATH"
|
||||
|
||||
./electrum "$@"
|
||||
./run_electrum "$@"
|
||||
|
||||
deactivate
|
||||
|
|
|
@ -10,5 +10,5 @@ from . import bitcoin
|
|||
from . import transaction
|
||||
from . import daemon
|
||||
from .transaction import Transaction
|
||||
from .plugins import BasePlugin
|
||||
from .plugin import BasePlugin
|
||||
from .commands import Commands, known_commands
|
|
@ -28,8 +28,9 @@ import os
|
|||
|
||||
import requests
|
||||
|
||||
from electrum import ELECTRUM_VERSION, constants
|
||||
from electrum.i18n import _
|
||||
from .version import ELECTRUM_VERSION
|
||||
from .import constants
|
||||
from .i18n import _
|
||||
|
||||
|
||||
class BaseCrashReporter(object):
|
|
@ -35,12 +35,12 @@ from decimal import Decimal
|
|||
|
||||
from .import util, ecc
|
||||
from .util import bfh, bh2u, format_satoshis, json_decode, print_error, json_encode
|
||||
from .import bitcoin
|
||||
from . import bitcoin
|
||||
from .bitcoin import is_address, hash_160, COIN, TYPE_ADDRESS
|
||||
from .i18n import _
|
||||
from .transaction import Transaction, multisig_script
|
||||
from .paymentrequest import PR_PAID, PR_UNPAID, PR_UNKNOWN, PR_EXPIRED
|
||||
from .plugins import run_hook
|
||||
from .plugin import run_hook
|
||||
|
||||
known_commands = {}
|
||||
|
|
@ -41,7 +41,7 @@ from .storage import WalletStorage
|
|||
from .commands import known_commands, Commands
|
||||
from .simple_config import SimpleConfig
|
||||
from .exchange_rate import FxThread
|
||||
from .plugins import run_hook
|
||||
from .plugin import run_hook
|
||||
|
||||
|
||||
def get_lockfile(config):
|
||||
|
@ -307,7 +307,7 @@ class Daemon(DaemonThread):
|
|||
gui_name = config.get('gui', 'qt')
|
||||
if gui_name in ['lite', 'classic']:
|
||||
gui_name = 'qt'
|
||||
gui = __import__('electrum_gui.' + gui_name, fromlist=['electrum_gui'])
|
||||
gui = __import__('electrum.gui.' + gui_name, fromlist=['electrum'])
|
||||
self.gui = gui.ElectrumGui(config, self, plugins)
|
||||
try:
|
||||
self.gui.main()
|
1
electrum/electrum
Symbolic link
|
@ -0,0 +1 @@
|
|||
../run_electrum
|
|
@ -10,10 +10,10 @@ prepare:
|
|||
# running pre build setup
|
||||
@cp tools/buildozer.spec ../../buildozer.spec
|
||||
# copy electrum to main.py
|
||||
@cp ../../electrum ../../main.py
|
||||
@cp ../../../run_electrum ../../main.py
|
||||
@-if [ ! -d "../../.buildozer" ];then \
|
||||
cd ../..; buildozer android debug;\
|
||||
cp -f gui/kivy/tools/blacklist.txt .buildozer/android/platform/python-for-android/src/blacklist.txt;\
|
||||
cp -f electrum/gui/kivy/tools/blacklist.txt .buildozer/android/platform/python-for-android/src/blacklist.txt;\
|
||||
rm -rf ./.buildozer/android/platform/python-for-android/dist;\
|
||||
fi
|
||||
apk:
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 224 B After Width: | Height: | Size: 224 B |
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 71 KiB |
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
|
@ -1,7 +1,7 @@
|
|||
#:import Clock kivy.clock.Clock
|
||||
#:import Window kivy.core.window.Window
|
||||
#:import Factory kivy.factory.Factory
|
||||
#:import _ electrum_gui.kivy.i18n._
|
||||
#:import _ electrum.gui.kivy.i18n._
|
||||
|
||||
|
||||
###########################
|
||||
|
@ -189,7 +189,7 @@
|
|||
Color:
|
||||
rgba: 0.192, .498, 0.745, 1
|
||||
BorderImage:
|
||||
source: 'atlas://gui/kivy/theming/light/card_bottom'
|
||||
source: 'atlas://electrum/gui/kivy/theming/light/card_bottom'
|
||||
size: self.size
|
||||
pos: self.pos
|
||||
|
||||
|
@ -203,7 +203,7 @@
|
|||
Color:
|
||||
rgba: 0.192, .498, 0.745, 1
|
||||
BorderImage:
|
||||
source: 'atlas://gui/kivy/theming/light/card_bottom'
|
||||
source: 'atlas://electrum/gui/kivy/theming/light/card_bottom'
|
||||
size: self.size
|
||||
pos: self.pos
|
||||
|
||||
|
@ -216,7 +216,7 @@
|
|||
Color:
|
||||
rgba: 0.192, .498, 0.745, 1
|
||||
BorderImage:
|
||||
source: 'atlas://gui/kivy/theming/light/card_bottom'
|
||||
source: 'atlas://electrum/gui/kivy/theming/light/card_bottom'
|
||||
size: self.size
|
||||
pos: self.pos
|
||||
|
||||
|
@ -326,8 +326,8 @@
|
|||
valign: 'middle'
|
||||
bold: True
|
||||
font_size: '12.5sp'
|
||||
background_normal: 'atlas://gui/kivy/theming/light/tab_btn'
|
||||
background_down: 'atlas://gui/kivy/theming/light/tab_btn_pressed'
|
||||
background_normal: 'atlas://electrum/gui/kivy/theming/light/tab_btn'
|
||||
background_down: 'atlas://electrum/gui/kivy/theming/light/tab_btn_pressed'
|
||||
|
||||
|
||||
<ColoredLabel@Label>:
|
||||
|
@ -416,14 +416,14 @@ BoxLayout:
|
|||
rgb: .6, .6, .6
|
||||
Rectangle:
|
||||
size: self.size
|
||||
source: 'gui/kivy/data/background.png'
|
||||
source: 'electrum/gui/kivy/data/background.png'
|
||||
|
||||
ActionBar:
|
||||
|
||||
ActionView:
|
||||
id: av
|
||||
ActionPrevious:
|
||||
app_icon: 'atlas://gui/kivy/theming/light/logo'
|
||||
app_icon: 'atlas://electrum/gui/kivy/theming/light/logo'
|
||||
app_icon_width: '100dp'
|
||||
with_previous: False
|
||||
size_hint_x: None
|
|
@ -7,13 +7,13 @@ import traceback
|
|||
from decimal import Decimal
|
||||
import threading
|
||||
|
||||
import electrum
|
||||
from electrum.bitcoin import TYPE_ADDRESS
|
||||
from electrum import WalletStorage, Wallet
|
||||
from electrum_gui.kivy.i18n import _
|
||||
from electrum.storage import WalletStorage
|
||||
from electrum.wallet import Wallet
|
||||
from electrum.i18n import _
|
||||
from electrum.paymentrequest import InvoiceStore
|
||||
from electrum.util import profiler, InvalidPassword
|
||||
from electrum.plugins import run_hook
|
||||
from electrum.plugin import run_hook
|
||||
from electrum.util import format_satoshis, format_satoshis_plain
|
||||
from electrum.paymentrequest import PR_UNPAID, PR_PAID, PR_UNKNOWN, PR_EXPIRED
|
||||
|
||||
|
@ -30,10 +30,10 @@ from kivy.metrics import inch
|
|||
from kivy.lang import Builder
|
||||
|
||||
## lazy imports for factory so that widgets can be used in kv
|
||||
#Factory.register('InstallWizard', module='electrum_gui.kivy.uix.dialogs.installwizard')
|
||||
#Factory.register('InfoBubble', module='electrum_gui.kivy.uix.dialogs')
|
||||
#Factory.register('OutputList', module='electrum_gui.kivy.uix.dialogs')
|
||||
#Factory.register('OutputItem', module='electrum_gui.kivy.uix.dialogs')
|
||||
#Factory.register('InstallWizard', module='electrum.gui.kivy.uix.dialogs.installwizard')
|
||||
#Factory.register('InfoBubble', module='electrum.gui.kivy.uix.dialogs')
|
||||
#Factory.register('OutputList', module='electrum.gui.kivy.uix.dialogs')
|
||||
#Factory.register('OutputItem', module='electrum.gui.kivy.uix.dialogs')
|
||||
|
||||
from .uix.dialogs.installwizard import InstallWizard
|
||||
from .uix.dialogs import InfoBubble, crash_reporter
|
||||
|
@ -56,16 +56,16 @@ from kivy.uix.tabbedpanel import TabbedPanel
|
|||
from kivy.uix.label import Label
|
||||
from kivy.core.clipboard import Clipboard
|
||||
|
||||
Factory.register('TabbedCarousel', module='electrum_gui.kivy.uix.screens')
|
||||
Factory.register('TabbedCarousel', module='electrum.gui.kivy.uix.screens')
|
||||
|
||||
# Register fonts without this you won't be able to use bold/italic...
|
||||
# inside markup.
|
||||
from kivy.core.text import Label
|
||||
Label.register('Roboto',
|
||||
'gui/kivy/data/fonts/Roboto.ttf',
|
||||
'gui/kivy/data/fonts/Roboto.ttf',
|
||||
'gui/kivy/data/fonts/Roboto-Bold.ttf',
|
||||
'gui/kivy/data/fonts/Roboto-Bold.ttf')
|
||||
'electrum/gui/kivy/data/fonts/Roboto.ttf',
|
||||
'electrum/gui/kivy/data/fonts/Roboto.ttf',
|
||||
'electrum/gui/kivy/data/fonts/Roboto-Bold.ttf',
|
||||
'electrum/gui/kivy/data/fonts/Roboto-Bold.ttf')
|
||||
|
||||
|
||||
from electrum.util import (base_units, NoDynamicFeeEstimates, decimal_point_to_base_unit_name,
|
||||
|
@ -363,7 +363,7 @@ class ElectrumWindow(App):
|
|||
memo = req.get('memo')
|
||||
amount = req.get('amount')
|
||||
fund = req.get('fund')
|
||||
popup = Builder.load_file('gui/kivy/uix/ui_screens/invoice.kv')
|
||||
popup = Builder.load_file('electrum/gui/kivy/uix/ui_screens/invoice.kv')
|
||||
popup.is_invoice = is_invoice
|
||||
popup.amount = amount
|
||||
popup.requestor = requestor if is_invoice else req.get('address')
|
||||
|
@ -382,7 +382,7 @@ class ElectrumWindow(App):
|
|||
from electrum.util import format_time
|
||||
fund = req.get('fund')
|
||||
isaddr = 'y'
|
||||
popup = Builder.load_file('gui/kivy/uix/ui_screens/invoice.kv')
|
||||
popup = Builder.load_file('electrum/gui/kivy/uix/ui_screens/invoice.kv')
|
||||
popup.isaddr = isaddr
|
||||
popup.is_invoice = False
|
||||
popup.status = status
|
||||
|
@ -435,7 +435,7 @@ class ElectrumWindow(App):
|
|||
currentActivity.startActivity(it)
|
||||
|
||||
def build(self):
|
||||
return Builder.load_file('gui/kivy/main.kv')
|
||||
return Builder.load_file('electrum/gui/kivy/main.kv')
|
||||
|
||||
def _pause(self):
|
||||
if platform == 'android':
|
||||
|
@ -592,7 +592,7 @@ class ElectrumWindow(App):
|
|||
d = WalletDialog()
|
||||
d.open()
|
||||
elif name == 'status':
|
||||
popup = Builder.load_file('gui/kivy/uix/ui_screens/'+name+'.kv')
|
||||
popup = Builder.load_file('electrum/gui/kivy/uix/ui_screens/'+name+'.kv')
|
||||
master_public_keys_layout = popup.ids.master_public_keys
|
||||
for xpub in self.wallet.get_master_public_keys()[1:]:
|
||||
master_public_keys_layout.add_widget(TopLabel(text=_('Master Public Key')))
|
||||
|
@ -602,7 +602,7 @@ class ElectrumWindow(App):
|
|||
master_public_keys_layout.add_widget(ref)
|
||||
popup.open()
|
||||
else:
|
||||
popup = Builder.load_file('gui/kivy/uix/ui_screens/'+name+'.kv')
|
||||
popup = Builder.load_file('electrum/gui/kivy/uix/ui_screens/'+name+'.kv')
|
||||
popup.open()
|
||||
|
||||
@profiler
|
||||
|
@ -618,9 +618,9 @@ class ElectrumWindow(App):
|
|||
|
||||
#setup lazy imports for mainscreen
|
||||
Factory.register('AnimatedPopup',
|
||||
module='electrum_gui.kivy.uix.dialogs')
|
||||
module='electrum.gui.kivy.uix.dialogs')
|
||||
Factory.register('QRCodeWidget',
|
||||
module='electrum_gui.kivy.uix.qrcodewidget')
|
||||
module='electrum.gui.kivy.uix.qrcodewidget')
|
||||
|
||||
# preload widgets. Remove this if you want to load the widgets on demand
|
||||
#Cache.append('electrum_widgets', 'AnimatedPopup', Factory.AnimatedPopup())
|
||||
|
@ -777,7 +777,7 @@ class ElectrumWindow(App):
|
|||
self.send_payment(address, amount=amount, label=label, message=message)
|
||||
|
||||
def show_error(self, error, width='200dp', pos=None, arrow_pos=None,
|
||||
exit=False, icon='atlas://gui/kivy/theming/light/error', duration=0,
|
||||
exit=False, icon='atlas://electrum/gui/kivy/theming/light/error', duration=0,
|
||||
modal=False):
|
||||
''' Show an error Message Bubble.
|
||||
'''
|
||||
|
@ -789,7 +789,7 @@ class ElectrumWindow(App):
|
|||
exit=False, duration=0, modal=False):
|
||||
''' Show an Info Message Bubble.
|
||||
'''
|
||||
self.show_error(error, icon='atlas://gui/kivy/theming/light/important',
|
||||
self.show_error(error, icon='atlas://electrum/gui/kivy/theming/light/important',
|
||||
duration=duration, modal=modal, exit=exit, pos=pos,
|
||||
arrow_pos=arrow_pos)
|
||||
|
||||
|
@ -829,7 +829,7 @@ class ElectrumWindow(App):
|
|||
info_bubble.show_arrow = False
|
||||
img.allow_stretch = True
|
||||
info_bubble.dim_background = True
|
||||
info_bubble.background_image = 'atlas://gui/kivy/theming/light/card'
|
||||
info_bubble.background_image = 'atlas://electrum/gui/kivy/theming/light/card'
|
||||
else:
|
||||
info_bubble.fs = False
|
||||
info_bubble.icon = icon
|
|
@ -41,4 +41,4 @@ class NFCBase(Widget):
|
|||
NFCScanner = core_select_lib('nfc_manager', (
|
||||
# keep the dummy implementation as the last one to make it the fallback provider.NFCScanner = core_select_lib('nfc_scanner', (
|
||||
('android', 'scanner_android', 'ScannerAndroid'),
|
||||
('dummy', 'scanner_dummy', 'ScannerDummy')), True, 'electrum_gui.kivy')
|
||||
('dummy', 'scanner_dummy', 'ScannerDummy')), True, 'electrum.gui.kivy')
|
|
@ -10,7 +10,7 @@ if platform != 'android':
|
|||
raise ImportError
|
||||
import threading
|
||||
|
||||
from electrum_gui.kivy.nfc_scanner import NFCBase
|
||||
from . import NFCBase
|
||||
from jnius import autoclass, cast
|
||||
from android.runnable import run_on_ui_thread
|
||||
from android import activity
|
|
@ -1,6 +1,6 @@
|
|||
''' Dummy NFC Provider to be used on desktops in case no other provider is found
|
||||
'''
|
||||
from electrum_gui.kivy.nfc_scanner import NFCBase
|
||||
from . import NFCBase
|
||||
from kivy.clock import Clock
|
||||
from kivy.logger import Logger
|
||||
|
Before Width: | Height: | Size: 552 B After Width: | Height: | Size: 552 B |
Before Width: | Height: | Size: 188 B After Width: | Height: | Size: 188 B |
Before Width: | Height: | Size: 380 B After Width: | Height: | Size: 380 B |
Before Width: | Height: | Size: 375 B After Width: | Height: | Size: 375 B |
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 683 B After Width: | Height: | Size: 683 B |
Before Width: | Height: | Size: 242 B After Width: | Height: | Size: 242 B |
Before Width: | Height: | Size: 311 B After Width: | Height: | Size: 311 B |
Before Width: | Height: | Size: 427 B After Width: | Height: | Size: 427 B |
Before Width: | Height: | Size: 362 B After Width: | Height: | Size: 362 B |
Before Width: | Height: | Size: 210 B After Width: | Height: | Size: 210 B |
Before Width: | Height: | Size: 209 B After Width: | Height: | Size: 209 B |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 866 B After Width: | Height: | Size: 866 B |
Before Width: | Height: | Size: 383 B After Width: | Height: | Size: 383 B |
Before Width: | Height: | Size: 357 B After Width: | Height: | Size: 357 B |
Before Width: | Height: | Size: 550 B After Width: | Height: | Size: 550 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 1 KiB |
Before Width: | Height: | Size: 3 KiB After Width: | Height: | Size: 3 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 8.3 KiB |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 5 KiB After Width: | Height: | Size: 5 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 330 B After Width: | Height: | Size: 330 B |
Before Width: | Height: | Size: 308 B After Width: | Height: | Size: 308 B |
Before Width: | Height: | Size: 393 B After Width: | Height: | Size: 393 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 178 KiB After Width: | Height: | Size: 178 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 9.9 KiB After Width: | Height: | Size: 9.9 KiB |
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
Before Width: | Height: | Size: 514 B After Width: | Height: | Size: 514 B |
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
Before Width: | Height: | Size: 244 B After Width: | Height: | Size: 244 B |
Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 9.1 KiB |