Skip to content

Commit

Permalink
UpgradeDownloader: actually use the downloaded data, for when that works
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles Samuels committed Mar 12, 2014
1 parent 94efe69 commit afbc7ca
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 73 deletions.
15 changes: 11 additions & 4 deletions ArmoryQt.py
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,11 @@ def execVersion():
execAbout = lambda: DlgHelpAbout(self).exec_()
execTrouble = lambda: webbrowser.open('https://bitcoinarmory.com/troubleshooting/')
execBugReport = lambda: DlgBugReport(self, self).exec_()
execDownloadUpgrade = lambda: UpgradeDownloaderDialog(self).exec_()
def execDownloadUpgrade():
dl = self.announceFetcher.getAnnounceFile('downloads')
cl = self.announceFetcher.getAnnounceFile('changelogs')
UpgradeDownloaderDialog(self, None, dl, cl).exec_()

execVerifySigned = lambda: VerifyOfflinePackageDialog(self).exec_()
actAboutWindow = self.createAction(tr('About Armory'), execAbout)
actVersionCheck = self.createAction(tr('Armory Version...'), execVersion)
Expand Down Expand Up @@ -4166,14 +4170,17 @@ def setupAnnounceTab(self):
scrollLayout.addWidget(self.announceScrollArea)
self.tabAnnounce.setLayout(scrollLayout)


#############################################################################
def openDLArmory(self):
UpgradeDownloaderDialog(self,self, 'Armory').exec_()
dl = self.announceFetcher.getAnnounceFile('downloads')
cl = self.announceFetcher.getAnnounceFile('changelogs')
UpgradeDownloaderDialog(self,self, 'Armory', dl, cl).exec_()

#############################################################################
def openDLSatoshi(self):
UpgradeDownloaderDialog(self,self, 'Satoshi').exec_()
dl = self.announceFetcher.getAnnounceFile('downloads')
cl = self.announceFetcher.getAnnounceFile('changelogs')
UpgradeDownloaderDialog(self,self, 'Satoshi', dl, cl).exec_()



Expand Down
93 changes: 24 additions & 69 deletions ui/UpgradeDownloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,68 +3,6 @@
from qtdefines import tr
from armoryengine.parseAnnounce import *

downloadTestText = """
-----BEGIN BITCOIN SIGNED MESSAGE-----
# Armory for Windows
Armory 0.91 Windows XP 32 http://url/armory_0.91_xp32.exe 3afb9881c32
Armory 0.91 Windows XP 64 http://url/armory_0.91_xp64.exe 8993ab127cf
Armory 0.91 Windows Vista,7,8 32,64 http://url/armory_0.91.exe 7f3b9964aa3
# Various Ubuntu/Debian versions
Armory 0.91 Ubuntu 10.04,10.10 32 http://url/armory_10.04-32.deb 01339a9469b59a15bedab3b90f0a9c90ff2ff712ffe1b8d767dd03673be8477f
Armory 0.91 Ubuntu 12.10,13.04 32 http://url/armory_12.04-32.deb 5541af39c84
Armory 0.91 Ubuntu 10.04,10.10 64 http://url/armory_10.04-64.deb 9af7613cab9
Armory 0.91 Ubuntu 13.10 64 http://url/armory_13.10-64.deb 013fccb961a
# Offline Bundles
ArmoryOffline 0.90 Ubuntu 10.04 32 http://url/offbundle-32-90.tar.gz 641382c93b9
ArmoryOffline 0.90 Ubuntu 12.10 32 http://url/offbundle-64-90.tar.gz 5541af39c84
ArmoryOffline 0.88 Ubuntu 10.04 32 http://url/offbundle-32-88.tar.gz 641382c93b9
ArmoryOffline 0.88 Ubuntu 12.10 32 http://url/offbundle-64-88.tar.gz 5541af39c84
# Windows 32-bit Satoshi (Bitcoin-Qt/bitcoind)
Satoshi 0.9.0 Windows XP,Vista,7,8 32,64 http://btc.org/win0.9.0.exe 837f6cb4981314b323350353e1ffed736badb1c8c0db083da4e5dfc0dd47cdf1
Satoshi 0.9.0 Ubuntu 10.04 32 http://btc.org/lin0.9.0.deb 2aa3f763c3b
Satoshi 0.9.0 Ubuntu 10.04 64 http://btc.org/lin0.9.0.deb 2aa3f763c3b
Satoshi 0.8.6 Debian 4 32 https://bitcoin.org/bin/0.8.6/bitcoin-0.8.6-linux.tar.gz 73495de53d1a30676884961e39ff46c3851ff770eeaa767331d065ff0ce8dd0c
-----BEGIN BITCOIN SIGNATURE-----
HAZGhRr4U/utHgk9BZVOTqWcAodtHLuIq67TMSdThAiZwcfpdjnYZ6ZwmkUj0c3W
U0zy72vLLx9mpKJQdDmV7k0=
=i8i+
-----END BITCOIN SIGNATURE-----
"""

changeLog = \
{ "Armory" : [ \
[ '0.91', 'January 27, 2014',
[ \
['Major Feature 1', 'This is a description of the first major feature.'],
['Major Feature 2', 'Description of the second big feature.'],
['Major Feature 3', 'Indentations might be malformed'] \
] \
],
[ '0.30', '',
[ \
['Major Feature 4', 'Another multi-line description'],
['Major Feature 5', 'Description of the fifth big feature.'] \
] \
],
[ '0.25', 'April 21, 2013',
[ \
['Major Feature 6', 'This feature requires interspersed comments'],
['Major Feature 7', ''],
['Major Feature 8', ''] \
] \
] \
]\
}

class UpgradeDownloader:
def __init__(self):
self.finishedCB = lambda : None
Expand Down Expand Up @@ -210,7 +148,11 @@ def progressTimer(self):


class UpgradeDownloaderDialog(QDialog):
def __init__(self, parent, downloadTextUnused=None, changeLogUnused=None):
# parent: QWidget
# showPackage: automatically select this package name, if available, for the current OS
# downloadText: the text *WITH SIGNATURE* of the downloaded text data
# changeLog: the text of the downloaded changelogs
def __init__(self, parent, showPackage, downloadText, changeLog):
super(QDialog, self).__init__(parent)

self.downloader = UpgradeDownloader()
Expand All @@ -233,14 +175,13 @@ def onStart():

self.downloader.setStartedCallback(onStart)

self.downloadText = downloadTestText # downloadTextUnused
self.nestedDownloadMap = downloadLinkParser(filetext=downloadTestText).downloadMap # downloadTextUnused
self.downloadText = downloadText
self.nestedDownloadMap = downloadLinkParser(filetext=downloadText).downloadMap
self.changelog = changeLog

self.localizedData = { \
"Ubuntu" : tr("Ubuntu"), \
"Ubuntu" : tr("Ubuntu/Debian"), \
"Windows" : tr("Windows"), \
"Debian" : tr("Debian"), \
"MacOS" : tr("MacOS"), \
"32" : tr("32-bit"), \
"64" : tr("64-bit"), \
Expand Down Expand Up @@ -304,12 +245,23 @@ def onStart():

self.cascadeOs()
self.selectMyOs()

if showPackage:
for n in range(0, packages.topLevelItemCount()):
row = packages.topLevelItem(n)
if row.data(0, 32)==n:
packages.setCurrentItem(n)
break

self.useSelectedPackage()

def selectMyOs(self):
if OS_WINDOWS:
self.os.setCurrentIndex(self.os.findData("Windows"))
self.osver.setCurrentIndex(self.osver.findData(platform.win32_ver()))
d = self.osver.findData(platform.win32_ver())
if d == -1:
d = 0
self.osver.setCurrentIndex(d)
elif OS_LINUX:
if OS_VARIANT == "debian":
d = self.os.findData("Debian")
Expand All @@ -321,7 +273,10 @@ def selectMyOs(self):
else:
self.os.setCurrentIndex(self.os.findData("Linux"))
elif OS_MACOSX:
self.os.setCurrentIndex(self.os.findData("MacOS"))
d = self.os.findData("MacOS")
if d == -1:
d = 0
self.os.setCurrentIndex(d)
self.osver.setCurrentIndex(self.osver.findData(platform.mac_ver()[0]))

if platform.machine() == "x86_64":
Expand Down

0 comments on commit afbc7ca

Please sign in to comment.