data/liveusb-creator.nsi | 3 liveusb-creator | 2 liveusb/creator.py | 4 liveusb/gui.py | 5 liveusb/releases.py | 11 + po/ku.po | 310 +++++++++++++++++++++++++++++++++++++++++++++++ setup.py | 2 7 files changed, 328 insertions(+), 9 deletions(-)
New commits: commit d6c1b937c26d633051d1c88794da018a2097fdb8 Merge: 44eac43 42ee44d Author: Luke Macken lmacken@redhat.com Date: Wed Oct 16 14:33:56 2013 -0600
Merge branch 'release/3.12.0'
commit 44eac43f95c61504e124080de35446f9ecd3412a Merge: 3753af3 8daf3b7 Author: Luke Macken lmacken@redhat.com Date: Wed Oct 16 14:33:08 2013 -0600
Merge branch 'master' of github.com:lmacken/liveusb-creator
Conflicts data/liveusb-creator.nsi
commit 42ee44d241bc4c42b0409e7754a7ab8a0dbbe887 Author: Luke Macken lmacken@redhat.com Date: Wed Oct 16 14:31:23 2013 -0600
Version bump
diff --git a/liveusb-creator b/liveusb-creator index e76002a..f7ce64b 100755 --- a/liveusb-creator +++ b/liveusb-creator @@ -23,7 +23,7 @@ import sys
from liveusb import _
-__version__ = '3.11.8' +__version__ = '3.12.0'
def parse_args(): from optparse import OptionParser diff --git a/setup.py b/setup.py index 7f32bad..d36da38 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from distutils.core import setup import sys, os
-VERSION = '3.11.8' +VERSION = '3.12.0'
LOCALE_DIR= '/usr/share/locale'
commit 1cc78037f476ac0946511969f29c36da69344e9c Author: Luke Macken lmacken@redhat.com Date: Mon Oct 14 17:36:00 2013 -0600
Display the actual error in the gui
diff --git a/liveusb/creator.py b/liveusb/creator.py index 7c011b0..b086b3e 100755 --- a/liveusb/creator.py +++ b/liveusb/creator.py @@ -199,9 +199,9 @@ class LiveUSBCreator(object): filename = self.write_log() if not passive: raise LiveUSBError(_("There was a problem executing the " - "following command: `%s`\nA more detailed " + "following command: `%s`\n%s\nA more detailed " "error log has been written to " - "'%s'" % (cmd, filename))) + "'%s'" % (cmd, err, filename))) return proc
def verify_iso_sha1(self, progress=None):
commit 4de8d34cdc6f5f2bd2544aa391db23cc7924e6f8 Author: Luke Macken lmacken@redhat.com Date: Mon Jul 29 15:56:13 2013 -0400
Fix a bug in the release downloader (fixes #5)
The release refresher button did not properly update the liveusb.releases.releases global.
diff --git a/liveusb/gui.py b/liveusb/gui.py index 659516e..920d392 100755 --- a/liveusb/gui.py +++ b/liveusb/gui.py @@ -338,9 +338,10 @@ class LiveUSBDialog(QtGui.QDialog, LiveUSBInterface):
def refresh_releases(self): self.live.log.info(_('Refreshing releases...')) - fedora_releases = get_fedora_releases() + global releases + releases = get_fedora_releases() self.downloadCombo.clear() - for release in [release['name'] for release in fedora_releases]: + for release in [release['name'] for release in releases]: self.downloadCombo.addItem(release) self.live.log.info(_('Releases updated!'))
commit fb691dd63bb8b569de553e72a31111aafdcb540e Author: Luke Macken lmacken@redhat.com Date: Thu Jun 20 13:28:50 2013 -0400
Add SoaS v7 to the releases list
diff --git a/liveusb/releases.py b/liveusb/releases.py index b483d7b..a585067 100644 --- a/liveusb/releases.py +++ b/liveusb/releases.py @@ -50,9 +50,14 @@ other_releases = [ ## Custom spins ## { - 'name': 'Sugar on a Stick v6 Pineapple', - 'url': 'https://alt.fedoraproject.org/pub/alt/spins/linux/releases/16/Spins/i686/Fed...', - 'sha256': '5aa938737cc4ebeb1d269c4d8b2bf56e41bacd1967c3997b8969b42b88b63bfa', + 'name': 'Sugar on a Stick v7 Quandong (x86_64)', + 'url': 'http://dl.fedoraproject.org/pub/alt/releases/17/Spins/x86_64/Fedora-17-x86_6...', + 'sha256': 'e872932ff02f20adc76252fff5fa16717b10a6d91dbee779bf4792d36c939a28', + }, + { + 'name': 'Sugar on a Stick v7 Quandong (i686)', + 'url': 'http://dl.fedoraproject.org/pub/alt/releases/17/Spins/i686/Fedora-17-i686-Li...', + 'sha256': '04a7824f36a4015985e328da450534a40a4babb0d0a2c8959e0bc9103b06721e', }, ]
commit 8c833814feffa024869240caf85a3490de8a5101 Merge: 19426d6 10ea92d Author: Luke Macken lewk@csh.rit.edu Date: Mon Jun 3 07:32:45 2013 -0700
Merge pull request #4 from havalabdulkarim/patch-1
Kurdish Sorani Translation
commit 10ea92d5c51e629fce03480dcb3e67e656d845b2 Author: Haval Abdulkarim haval.abdulkarim@gmail.com Date: Sun Jun 2 03:38:26 2013 +0300
Create ku.po
Kurdish Sorani Translation
diff --git a/po/ku.po b/po/ku.po new file mode 100644 index 0000000..82675c4 --- /dev/null +++ b/po/ku.po @@ -0,0 +1,310 @@ +# Kurdish Sorani translation of liveusb-creator. +# Copyright (C) 2013 liveusb-creator's COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# Haval A. Ahmed havalabdulkarim@fedoraproject.org, 2013. +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2013-06-02 03:03-0400\n" +"PO-Revision-Date: 2013-06-02 03:03+0100\n" +"Last-Translator: Haval A. Ahmed haval.abdulkarim@gmail.com\n" +"Language-Team: Kurdish Sorani <>\n" +"Language: ku\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Virtaal 0.5.2\n" + +#: ../liveusb/gui.py:69 +#, python-format +msgid "Unknown release: %s" +msgstr "وەشانی نەناسراو: %s" + +#: ../liveusb/gui.py:73 +#, python-format +msgid "Downloading %s..." +msgstr "داگرتن %s..." + +#: ../liveusb/gui.py:152 +msgid "Verifying filesystem..." +msgstr "پشکنینی فایلی سیستەم..." + +#: ../liveusb/gui.py:155 +msgid "" +"Error: Cannot set the label or obtain the UUID of your device. Unable to " +"continue." +msgstr "" +"هەڵە: ناتوانرێت ناونیشان دابنرێت یان یو یو ئای دی دابین بکرێت. ناتوانرێت بەردەوام بێت" + +#: ../liveusb/gui.py:164 +msgid "Verifying SHA1 of LiveCD image..." +msgstr "پشکنینی شا١ی لایڤ سیدی لەبەرگیراوە" + +#: ../liveusb/gui.py:166 +msgid "" +"Error: The SHA1 of your Live CD is invalid. You can run this program with " +"the --noverify argument to bypass this verification check." +msgstr "" +"Error: The SHA1 of your Live CD is invalid. You can run this program with " +"the --noverify argument to bypass this verification check." + +#: ../liveusb/gui.py:177 +msgid "Extracting live image to USB device..." +msgstr "Extracting live image to USB device..." + +#: ../liveusb/gui.py:180 +#, python-format +msgid "Creating %d Mb persistent overlay..." +msgstr "Creating %d Mb persistent overlay..." + +#: ../liveusb/gui.py:183 +msgid "Configuring and installing bootloader..." +msgstr "Configuring and installing bootloader..." + +#: ../liveusb/gui.py:187 +#, python-format +msgid "Complete! (%s)" +msgstr "تەواوبوو (%s)" + +#: ../liveusb/gui.py:190 ../liveusb/gui.py:193 +msgid "LiveUSB creation failed!" +msgstr "دروستکردنی لایڤ "یو ئێس بی" سەرکەوتوو نەبوو" + +#: ../liveusb/gui.py:316 +#, python-format +msgid "Persistent Storage (%d Mb)" +msgstr "قەبارەی شێوازی بیرگە (%d Mb)" + +#: ../liveusb/gui.py:334 +msgid "" +"Your device already contains a LiveOS.\n" +"If you continue, this will be overwritten." +msgstr "" +"Your device already contains a LiveOS.\n" +"If you continue, this will be overwritten." + +#: ../liveusb/gui.py:337 +msgid "" +"Warning: Creating a new persistent overlay will delete your existing one." +msgstr "" +"Warning: Creating a new persistent overlay will delete your existing one." + +#: ../liveusb/gui.py:339 +msgid "Press 'Create Live USB' again if you wish to continue." +msgstr "Press 'Create Live USB' again if you wish to continue." + +#. The user has confirmed that they wish to overwrite their +#. existing Live OS. Here we delete it first, in order to +#. accurately calculate progress. +#: ../liveusb/gui.py:349 +msgid "Removing existing Live OS..." +msgstr "Removing existing Live OS..." + +#: ../liveusb/gui.py:383 +msgid "Download complete!" +msgstr "داگرتن تەواو!" + +#: ../liveusb/gui.py:387 +msgid "Download failed: " +msgstr "داگرتن سەرکەوتوو نەبوو: " + +#: ../liveusb/gui.py:388 +msgid "You can try again to resume your download" +msgstr "دەتوانیت دوبارە هەوڵبدەیت بۆ بەردەوامبوونی داگرتن" + +#: ../liveusb/gui.py:392 +msgid "Select Live ISO" +msgstr "لایڤ "ئای ئێس ئۆ" هەڵبژێرە" + +#: ../liveusb/gui.py:399 +msgid "" +"Sorry, I'm having trouble encoding the filename of your livecd. You may " +"have better luck if you move your ISO to the root of your drive (ie: C:\)" +msgstr "" +"Sorry, I'm having trouble encoding the filename of your livecd. You may " +"have better luck if you move your ISO to the root of your drive (ie: C:\)" + +#: ../liveusb/gui.py:404 +#, python-format +msgid "ISO selected: %s" +msgstr ""ئای ئێس ئۆ" هەڵبژێردرا: %s" + +#: ../liveusb/creator.py:146 +#, python-format +msgid "" +"There was a problem executing the following command: `%s`\n" +"A more detailed error log has been written to 'liveusb-creator.log'" +msgstr "" +"There was a problem executing the following command: `%s`\n" +"A more detailed error log has been written to 'liveusb-creator.log'" + +#: ../liveusb/creator.py:183 +msgid "Not enough free space on device." +msgstr "شوێنی بەتاڵێ تەواو نیە لەسەر ئامێرەکە" + +#: ../liveusb/creator.py:190 +#, python-format +msgid "Creating %sMB persistent overlay" +msgstr "Creating %sMB persistent overlay" + +#: ../liveusb/creator.py:226 +#, python-format +msgid "Unable to remove previous LiveOS: %s" +msgstr "Unable to remove previous LiveOS: %s" + +#: ../liveusb/creator.py:257 +#, python-format +msgid "Cannot find device %s" +msgstr "Cannot find device %s" + +#: ../liveusb/creator.py:306 +msgid "Unable to find any USB drives" +msgstr "Unable to find any USB drives" + +#: ../liveusb/creator.py:327 +#, python-format +msgid "Filesystem for %s unknown!" +msgstr "Filesystem for %s unknown!" + +#: ../liveusb/creator.py:335 +#, python-format +msgid "Unable to mount device: %s" +msgstr "Unable to mount device: %s" + +#: ../liveusb/creator.py:370 +#, python-format +msgid "Unknown filesystem for %s. Your device may need to be reformatted." +msgstr "Unknown filesystem for %s. Your device may need to be reformatted." + +#: ../liveusb/creator.py:373 +#, python-format +msgid "Unsupported filesystem: %s" +msgstr "فایلی سیستەمی پاڵپشت نەکراو: %s" + +#: ../liveusb/creator.py:400 +msgid "Unable to find LiveOS on ISO" +msgstr "ناتوانرێت لایف ئۆ ئێس لەسەر "ئای ئێس ئۆ"کە بدۆزرێتەوە" + +#: ../liveusb/creator.py:472 +msgid "Unable to find any removable devices" +msgstr "Unable to find any removable devices" + +#: ../liveusb/creator.py:479 +msgid "" +"Make sure your USB key is plugged in and formatted with the FAT filesystem" +msgstr "" +"Make sure your USB key is plugged in and formatted with the FAT filesystem" + +#: ../liveusb/creator.py:482 +#, python-format +msgid "" +"Unsupported filesystem: %s\n" +"Please backup and format your USB key with the FAT filesystem." +msgstr "" +"Unsupported filesystem: %s\n" +"Please backup and format your USB key with the FAT filesystem." + +#: ../liveusb/creator.py:558 +#, python-format +msgid "" +"Cannot find '%s'. Make sure to extract the entire liveusb-creator zip file " +"before running this program." +msgstr "" +"Cannot find '%s'. Make sure to extract the entire liveusb-creator zip file " +"before running this program." + +#: ../liveusb/dialog.py:123 +msgid "Fedora LiveUSB Creator" +msgstr "Fedora LiveUSB Creator" + +#: ../liveusb/dialog.py:124 +msgid "" +"This button will begin the LiveUSB creation process. This entails " +"optionally downloading a release (if an existing one wasn't selected), " +"extracting the ISO to the USB device, creating the persistent overlay, and " +"installing the bootloader." +msgstr "" +"This button will begin the LiveUSB creation process. This entails " +"optionally downloading a release (if an existing one wasn't selected), " +"extracting the ISO to the USB device, creating the persistent overlay, and " +"installing the bootloader." + +#: ../liveusb/dialog.py:125 +msgid "Create Live USB" +msgstr "لایڤ "یو ئێس بی" دروست بکە" + +#: ../liveusb/dialog.py:126 +msgid "This is the status console, where all messages get written to." +msgstr "This is the status console, where all messages get written to." + +#: ../liveusb/dialog.py:127 +msgid "" +"This is the progress bar that will indicate how far along in the LiveUSB " +"creation process you are" +msgstr "" +"This is the progress bar that will indicate how far along in the LiveUSB " +"creation process you are" + +#: ../liveusb/dialog.py:128 +msgid "" +"If you do not select an existing Live CD, the selected release will be " +"downloaded for you." +msgstr "" +"If you do not select an existing Live CD, the selected release will be " +"downloaded for you." + +#: ../liveusb/dialog.py:129 +msgid "Download Fedora" +msgstr "Download Fedora" + +#: ../liveusb/dialog.py:130 +msgid "or" +msgstr "یان" + +#: ../liveusb/dialog.py:131 +msgid "" +"This button allows you to browse for an existing Live CD ISO that you have " +"previously downloaded. If you do not select one, a release will be " +"downloaded for you automatically." +msgstr "" +"This button allows you to browse for an existing Live CD ISO that you have " +"previously downloaded. If you do not select one, a release will be " +"downloaded for you automatically." + +#: ../liveusb/dialog.py:132 +msgid "Use existing Live CD" +msgstr "لایڤ سیدی ئامادە بەکاربێنە" + +#: ../liveusb/dialog.py:133 +msgid "Browse" +msgstr "گەڕان" + +#: ../liveusb/dialog.py:135 +msgid "" +"This is the USB stick that you want to install your Live CD on. This device " +"must be formatted with the FAT filesystem." +msgstr "" +"This is the USB stick that you want to install your Live CD on. This device " +"must be formatted with the FAT filesystem." + +#: ../liveusb/dialog.py:136 +msgid "Target Device" +msgstr "ئامێری مەبەست" + +#: ../liveusb/dialog.py:137 +msgid "" +"By allocating extra space on your USB stick for a persistent overlay, you " +"will be able to store data and make permanent modifications to your live " +"operating system. Without it, you will not be able to save data that will " +"persist after a reboot." +msgstr "" +"By allocating extra space on your USB stick for a persistent overlay, you " +"will be able to store data and make permanent modifications to your live " +"operating system. Without it, you will not be able to save data that will " +"persist after a reboot." + +#: ../liveusb/dialog.py:138 +msgid "Persistent Storage (0 Mb)" +msgstr "قەبارەی شێوازی بیرگە (%0 Mb)"
commit 8daf3b753b6b621c6ee2ba5e0c1a2eec41865b38 Merge: 4f8d12b 19426d6 Author: Luke Macken lmacken@redhat.com Date: Tue Apr 30 12:17:40 2013 -0400
Merge branch 'develop'
diff --cc data/liveusb-creator.nsi index 03f3760,9f6aefd..8412a13 --- a/data/liveusb-creator.nsi +++ b/data/liveusb-creator.nsi @@@ -1,9 -1,9 +1,12 @@@ - Name "LiveUSB Creator 3.11.7" - OutFile "liveusb-creator-3.11.7-setup.exe" + Name "LiveUSB Creator 3.11.8" + OutFile "liveusb-creator-3.11.8-setup.exe" + + !include "MUI2.nsh" + XPStyle on
+!include "MUI2.nsh" +XPStyle on + SetCompressor lzma
InstallDir "$PROGRAMFILES\LiveUSB Creator"
commit 19426d6009ee0d5577bdf7f7c677428884c9a1d7 Author: Luke Macken lmacken@redhat.com Date: Tue Apr 23 13:58:02 2013 -0400
Add mswsock.dll to the py2exe dll_excludes to fix an error
diff --git a/setup.py b/setup.py index 7d0b526..7f32bad 100644 --- a/setup.py +++ b/setup.py @@ -62,8 +62,10 @@ if sys.platform == 'win32': #"includes" : ["sip", "PyQt4._qt"], "includes" : ["sip"], 'bundle_files': 1, + # http://stackoverflow.com/questions/1439621/problem-with-loading-win32file-py... + "dll_excludes": ["mswsock.dll", "MSWSOCK.dll"], } - }, + }, zipfile=None, data_files = [ "LICENSE.txt",
commit f3680be77592768004baf4689fe77a40edbb5119 Author: Luke Macken lmacken@redhat.com Date: Tue Apr 23 13:54:52 2013 -0400
Revert "Update our win32 syslinux binary to 5.01".
We can't do this until Fedora uses syslinux 5.x, as we are still stuck on 4.
diff --git a/tools/syslinux.exe b/tools/syslinux.exe index 0e25655..a67dc0d 100644 Binary files a/tools/syslinux.exe and b/tools/syslinux.exe differ
commit 064336224ac43bdbf2541f014f639a1c83ea480d Author: Luke Macken lmacken@redhat.com Date: Tue Apr 23 13:05:02 2013 -0400
Generate a fresh windows_dialog.py with the new release refresher button
diff --git a/liveusb/windows_dialog.py b/liveusb/windows_dialog.py index d9e28c8..f25a459 100644 --- a/liveusb/windows_dialog.py +++ b/liveusb/windows_dialog.py @@ -2,120 +2,141 @@
# Form implementation generated from reading ui file 'data/liveusb-creator.ui' # -# Created: Wed Sep 3 03:31:13 2008 -# by: PyQt4 UI code generator 4.4.2 +# Created: Tue Apr 23 13:03:23 2013 +# by: PyQt4 UI code generator 4.10 # # WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui -from liveusb import utf8_gettext as _ + +try: + _fromUtf8 = QtCore.QString.fromUtf8 +except AttributeError: + def _fromUtf8(s): + return s + +try: + _encoding = QtGui.QApplication.UnicodeUTF8 + def _translate(context, text, disambig): + return QtGui.QApplication.translate(context, text, disambig, _encoding) +except AttributeError: + def _translate(context, text, disambig): + return QtGui.QApplication.translate(context, text, disambig)
class Ui_Dialog(object): def setupUi(self, Dialog): - Dialog.setObjectName("Dialog") - Dialog.resize(422,388) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed,QtGui.QSizePolicy.Fixed) + Dialog.setObjectName(_fromUtf8("Dialog")) + Dialog.resize(422, 388) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(Dialog.sizePolicy().hasHeightForWidth()) Dialog.setSizePolicy(sizePolicy) self.startButton = QtGui.QPushButton(Dialog) self.startButton.setEnabled(True) - self.startButton.setGeometry(QtCore.QRect(130,350,158,34)) - self.startButton.setObjectName("startButton") + self.startButton.setGeometry(QtCore.QRect(130, 350, 158, 34)) + self.startButton.setObjectName(_fromUtf8("startButton")) self.textEdit = QtGui.QTextEdit(Dialog) - self.textEdit.setGeometry(QtCore.QRect(10,200,401,111)) + self.textEdit.setGeometry(QtCore.QRect(10, 200, 401, 111)) font = QtGui.QFont() font.setPointSize(8) self.textEdit.setFont(font) self.textEdit.setReadOnly(True) - self.textEdit.setObjectName("textEdit") + self.textEdit.setObjectName(_fromUtf8("textEdit")) self.progressBar = QtGui.QProgressBar(Dialog) - self.progressBar.setGeometry(QtCore.QRect(10,320,401,23)) - self.progressBar.setProperty("value",QtCore.QVariant(0)) - self.progressBar.setObjectName("progressBar") + self.progressBar.setGeometry(QtCore.QRect(10, 320, 401, 23)) + self.progressBar.setProperty("value", 0) + self.progressBar.setObjectName(_fromUtf8("progressBar")) self.downloadGroup = QtGui.QGroupBox(Dialog) - self.downloadGroup.setGeometry(QtCore.QRect(210,80,201,51)) + self.downloadGroup.setGeometry(QtCore.QRect(210, 80, 201, 51)) font = QtGui.QFont() font.setPointSize(8) self.downloadGroup.setFont(font) - self.downloadGroup.setObjectName("downloadGroup") + self.downloadGroup.setObjectName(_fromUtf8("downloadGroup")) self.downloadCombo = QtGui.QComboBox(self.downloadGroup) - self.downloadCombo.setGeometry(QtCore.QRect(10,20,181,22)) - self.downloadCombo.setObjectName("downloadCombo") + self.downloadCombo.setGeometry(QtCore.QRect(10, 20, 161, 22)) + self.downloadCombo.setObjectName(_fromUtf8("downloadCombo")) + self.refreshReleasesButton = QtGui.QPushButton(self.downloadGroup) + self.refreshReleasesButton.setGeometry(QtCore.QRect(170, 20, 30, 20)) + self.refreshReleasesButton.setText(_fromUtf8("")) + icon = QtGui.QIcon() + icon.addPixmap(QtGui.QPixmap(_fromUtf8(":/refresh.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.refreshReleasesButton.setIcon(icon) + self.refreshReleasesButton.setFlat(True) + self.refreshReleasesButton.setObjectName(_fromUtf8("refreshReleasesButton")) self.label_2 = QtGui.QLabel(Dialog) - self.label_2.setGeometry(QtCore.QRect(180,100,23,24)) + self.label_2.setGeometry(QtCore.QRect(180, 100, 23, 24)) font = QtGui.QFont() - font.setFamily("Verdana") + font.setFamily(_fromUtf8("Verdana")) font.setPointSize(10) - font.setWeight(75) font.setBold(True) + font.setWeight(75) self.label_2.setFont(font) - self.label_2.setObjectName("label_2") + self.label_2.setObjectName(_fromUtf8("label_2")) self.groupBox = QtGui.QGroupBox(Dialog) - self.groupBox.setGeometry(QtCore.QRect(10,80,161,51)) + self.groupBox.setGeometry(QtCore.QRect(10, 80, 161, 51)) font = QtGui.QFont() font.setPointSize(8) self.groupBox.setFont(font) - self.groupBox.setObjectName("groupBox") + self.groupBox.setObjectName(_fromUtf8("groupBox")) self.isoBttn = QtGui.QPushButton(self.groupBox) - self.isoBttn.setGeometry(QtCore.QRect(11,18,141,25)) - self.isoBttn.setObjectName("isoBttn") + self.isoBttn.setGeometry(QtCore.QRect(11, 18, 141, 25)) + self.isoBttn.setObjectName(_fromUtf8("isoBttn")) self.groupBox_2 = QtGui.QGroupBox(Dialog) - self.groupBox_2.setGeometry(QtCore.QRect(10,140,191,51)) + self.groupBox_2.setGeometry(QtCore.QRect(10, 140, 191, 51)) font = QtGui.QFont() font.setPointSize(8) self.groupBox_2.setFont(font) - self.groupBox_2.setObjectName("groupBox_2") + self.groupBox_2.setObjectName(_fromUtf8("groupBox_2")) self.driveBox = QtGui.QComboBox(self.groupBox_2) - self.driveBox.setGeometry(QtCore.QRect(10,20,145,20)) + self.driveBox.setGeometry(QtCore.QRect(10, 20, 151, 21)) self.driveBox.setEditable(False) self.driveBox.setInsertPolicy(QtGui.QComboBox.InsertAtTop) self.driveBox.setDuplicatesEnabled(False) - self.driveBox.setObjectName("driveBox") + self.driveBox.setObjectName(_fromUtf8("driveBox")) self.refreshDevicesButton = QtGui.QPushButton(self.groupBox_2) - self.refreshDevicesButton.setGeometry(QtCore.QRect(156,16,30,26)) - icon = QtGui.QIcon() - icon.addFile(":/refresh.png") + self.refreshDevicesButton.setGeometry(QtCore.QRect(160, 20, 30, 20)) + self.refreshDevicesButton.setText(_fromUtf8("")) self.refreshDevicesButton.setIcon(icon) self.refreshDevicesButton.setFlat(True) - self.refreshDevicesButton.setObjectName("refreshDevicesButton") + self.refreshDevicesButton.setObjectName(_fromUtf8("refreshDevicesButton")) self.overlayTitle = QtGui.QGroupBox(Dialog) - self.overlayTitle.setGeometry(QtCore.QRect(210,140,201,51)) + self.overlayTitle.setGeometry(QtCore.QRect(210, 140, 201, 51)) font = QtGui.QFont() font.setPointSize(8) self.overlayTitle.setFont(font) - self.overlayTitle.setObjectName("overlayTitle") + self.overlayTitle.setObjectName(_fromUtf8("overlayTitle")) self.overlaySlider = QtGui.QSlider(self.overlayTitle) - self.overlaySlider.setGeometry(QtCore.QRect(10,20,181,21)) + self.overlaySlider.setGeometry(QtCore.QRect(10, 20, 181, 21)) self.overlaySlider.setMaximum(2047) self.overlaySlider.setOrientation(QtCore.Qt.Horizontal) self.overlaySlider.setTickPosition(QtGui.QSlider.NoTicks) - self.overlaySlider.setObjectName("overlaySlider") + self.overlaySlider.setObjectName(_fromUtf8("overlaySlider")) self.label = QtGui.QLabel(Dialog) - self.label.setGeometry(QtCore.QRect(0,0,430,72)) - self.label.setPixmap(QtGui.QPixmap(":/liveusb-header.png")) - self.label.setObjectName("label") + self.label.setGeometry(QtCore.QRect(0, 0, 430, 72)) + self.label.setText(_fromUtf8("")) + self.label.setPixmap(QtGui.QPixmap(_fromUtf8(":/liveusb-header.png"))) + self.label.setObjectName(_fromUtf8("label"))
self.retranslateUi(Dialog) QtCore.QMetaObject.connectSlotsByName(Dialog)
def retranslateUi(self, Dialog): - Dialog.setWindowTitle(QtGui.QApplication.translate("Dialog", _("Fedora LiveUSB Creator"), None, QtGui.QApplication.UnicodeUTF8)) - self.startButton.setWhatsThis(QtGui.QApplication.translate("Dialog", _("This button will begin the LiveUSB creation process. This entails optionally downloading a release (if an existing one wasn't selected), extracting the ISO to the USB device, creating the persistent overlay, and installing the bootloader."), None, QtGui.QApplication.UnicodeUTF8)) - self.startButton.setText(QtGui.QApplication.translate("Dialog", _("Create Live USB"), None, QtGui.QApplication.UnicodeUTF8)) - self.textEdit.setWhatsThis(QtGui.QApplication.translate("Dialog", _("This is the status console, where all messages get written to."), None, QtGui.QApplication.UnicodeUTF8)) - self.progressBar.setWhatsThis(QtGui.QApplication.translate("Dialog", _("This is the progress bar that will indicate how far along in the LiveUSB creation process you are"), None, QtGui.QApplication.UnicodeUTF8)) - self.downloadGroup.setWhatsThis(QtGui.QApplication.translate("Dialog", _("If you do not select an existing Live CD, the selected release will be downloaded for you."), None, QtGui.QApplication.UnicodeUTF8)) - self.downloadGroup.setTitle(QtGui.QApplication.translate("Dialog", _("Download Fedora"), None, QtGui.QApplication.UnicodeUTF8)) - self.label_2.setText(QtGui.QApplication.translate("Dialog", _("or"), None, QtGui.QApplication.UnicodeUTF8)) - self.groupBox.setWhatsThis(QtGui.QApplication.translate("Dialog", _("This button allows you to browse for an existing Live CD ISO that you have previously downloaded. If you do not select one, a release will be downloaded for you automatically."), None, QtGui.QApplication.UnicodeUTF8)) - self.groupBox.setTitle(QtGui.QApplication.translate("Dialog", _("Use existing Live CD"), None, QtGui.QApplication.UnicodeUTF8)) - self.isoBttn.setText(QtGui.QApplication.translate("Dialog", _("Browse"), None, QtGui.QApplication.UnicodeUTF8)) - self.isoBttn.setShortcut(QtGui.QApplication.translate("Dialog", "Alt+B", None, QtGui.QApplication.UnicodeUTF8)) - self.groupBox_2.setWhatsThis(QtGui.QApplication.translate("Dialog", _("This is the USB stick that you want to install your Live CD on. This device must be formatted with the FAT filesystem."), None, QtGui.QApplication.UnicodeUTF8)) - self.groupBox_2.setTitle(QtGui.QApplication.translate("Dialog", _("Target Device"), None, QtGui.QApplication.UnicodeUTF8)) - self.overlayTitle.setWhatsThis(QtGui.QApplication.translate("Dialog", _("By allocating extra space on your USB stick for a persistent overlay, you will be able to store data and make permanent modifications to your live operating system. Without it, you will not be able to save data that will persist after a reboot."), None, QtGui.QApplication.UnicodeUTF8)) - self.overlayTitle.setTitle(QtGui.QApplication.translate("Dialog", _("Persistent Storage (0 Mb)"), None, QtGui.QApplication.UnicodeUTF8)) + Dialog.setWindowTitle(_translate("Dialog", "Fedora LiveUSB Creator", None)) + self.startButton.setWhatsThis(_translate("Dialog", "This button will begin the LiveUSB creation process. This entails optionally downloading a release (if an existing one wasn't selected), extracting the ISO to the USB device, creating the persistent overlay, and installing the bootloader.", None)) + self.startButton.setText(_translate("Dialog", "Create Live USB", None)) + self.textEdit.setWhatsThis(_translate("Dialog", "This is the status console, where all messages get written to.", None)) + self.progressBar.setWhatsThis(_translate("Dialog", "This is the progress bar that will indicate how far along in the LiveUSB creation process you are", None)) + self.downloadGroup.setWhatsThis(_translate("Dialog", "If you do not select an existing Live CD, the selected release will be downloaded for you.", None)) + self.downloadGroup.setTitle(_translate("Dialog", "Download Fedora", None)) + self.label_2.setText(_translate("Dialog", "or", None)) + self.groupBox.setWhatsThis(_translate("Dialog", "This button allows you to browse for an existing Live CD ISO that you have previously downloaded. If you do not select one, a release will be downloaded for you automatically.", None)) + self.groupBox.setTitle(_translate("Dialog", "Use existing Live CD", None)) + self.isoBttn.setText(_translate("Dialog", "Browse", None)) + self.isoBttn.setShortcut(_translate("Dialog", "Alt+B", None)) + self.groupBox_2.setWhatsThis(_translate("Dialog", "This is the USB stick that you want to install your Live CD on. This device must be formatted with the FAT filesystem.", None)) + self.groupBox_2.setTitle(_translate("Dialog", "Target Device", None)) + self.overlayTitle.setWhatsThis(_translate("Dialog", "By allocating extra space on your USB stick for a persistent overlay, you will be able to store data and make permanent modifications to your live operating system. Without it, you will not be able to save data that will persist after a reboot.", "comment!")) + self.overlayTitle.setTitle(_translate("Dialog", "Persistent Storage (0 MB)", None))
import resources_rc
commit 8788bca09490946bfbf16ae17b5dca545db29492 Author: Luke Macken lmacken@redhat.com Date: Tue Apr 23 13:00:39 2013 -0400
Bump the version in our nsi configs
diff --git a/data/liveusb-creator.nsi b/data/liveusb-creator.nsi index 03f3760..9f6aefd 100644 --- a/data/liveusb-creator.nsi +++ b/data/liveusb-creator.nsi @@ -1,5 +1,5 @@ -Name "LiveUSB Creator 3.11.7" -OutFile "liveusb-creator-3.11.7-setup.exe" +Name "LiveUSB Creator 3.11.8" +OutFile "liveusb-creator-3.11.8-setup.exe"
!include "MUI2.nsh" XPStyle on diff --git a/data/liveusb-creator.nsi.in b/data/liveusb-creator.nsi.in index 943c3fb..8beba06 100755 --- a/data/liveusb-creator.nsi.in +++ b/data/liveusb-creator.nsi.in @@ -1,8 +1,8 @@ ;-------------------------------- -;LiveUSB Crator NSIS script +;LiveUSB Creator NSIS script
-Name "LiveUSB Creator 3.11.6" -OutFile "liveusb-creator-3.11.6-setup.exe" +Name "LiveUSB Creator 3.11.8" +OutFile "liveusb-creator-3.11.8-setup.exe"
SetCompressor lzma
commit 3b7e8fe3da0cbc6f26b63c05a811b31d8bd14610 Author: Luke Macken lmacken@redhat.com Date: Tue Apr 23 12:57:55 2013 -0400
Update our win32 syslinux binary to 5.01
diff --git a/tools/syslinux.exe b/tools/syslinux.exe index a67dc0d..0e25655 100644 Binary files a/tools/syslinux.exe and b/tools/syslinux.exe differ
commit 2bbd7c326c2248244b0a1ffef875e080f5398b87 Author: Luke Macken lmacken@redhat.com Date: Tue Apr 23 12:55:25 2013 -0400
Change our overlay restriciton warnings to debug messages
This ensures that windows users don't always get an error dialog popup upon completion.
diff --git a/liveusb/gui.py b/liveusb/gui.py index d6deecd..659516e 100755 --- a/liveusb/gui.py +++ b/liveusb/gui.py @@ -412,12 +412,12 @@ class LiveUSBDialog(QtGui.QDialog, LiveUSBInterface): current_overlay = self.overlaySlider.value()
if device['fsversion'] == 'FAT32': - self.live.log.warning(_('Partition is FAT32; Restricting overlay ' - 'size to 4G')) + self.live.log.debug(_('Partition is FAT32; Restricting overlay ' + 'size to 4G')) max_space = MAX_FAT32 elif device['fsversion'] == 'FAT16': - self.live.log.warning(_('Partition is FAT16; Restricting overlay ' - 'size to 2G')) + self.live.log.debug(_('Partition is FAT16; Restricting overlay ' + 'size to 2G')) max_space = MAX_FAT16 else: max_space = MAX_EXT
commit 76786f8404dd82599220e9d065e1d5a836f155e2 Author: Luke Macken lmacken@redhat.com Date: Tue Apr 23 12:55:12 2013 -0400
Show warnings in the gui
diff --git a/liveusb/gui.py b/liveusb/gui.py index e1491d4..d6deecd 100755 --- a/liveusb/gui.py +++ b/liveusb/gui.py @@ -261,7 +261,7 @@ class LiveUSBLogHandler(logging.Handler): self.cb = cb
def emit(self, record): - if record.levelname in ('INFO', 'ERROR'): + if record.levelname in ('INFO', 'ERROR', 'WARN'): self.cb(record.msg)
commit fb3d08a58a7317d5bafe7dcdb9cf535d42703250 Author: Luke Macken lmacken@redhat.com Date: Mon Apr 22 15:13:21 2013 -0400
Stop our progress thread before unmounting
diff --git a/liveusb/gui.py b/liveusb/gui.py index fb0d677..e1491d4 100755 --- a/liveusb/gui.py +++ b/liveusb/gui.py @@ -130,6 +130,7 @@ class ProgressThread(QtCore.QThread): orig_free = 0 drive = None get_free_bytes = None + alive = True
def set_data(self, size, drive, freebytes): self.totalsize = size / 1024 @@ -139,7 +140,7 @@ class ProgressThread(QtCore.QThread): self.emit(QtCore.SIGNAL("maxprogress(int)"), self.totalsize)
def run(self): - while True: + while self.alive: free = self.get_free_bytes() value = (self.orig_free - free) / 1024 self.emit(QtCore.SIGNAL("progress(int)"), value) @@ -147,6 +148,9 @@ class ProgressThread(QtCore.QThread): break sleep(3)
+ def stop(self): + self.alive = False + def terminate(self): self.emit(QtCore.SIGNAL("progress(int)"), self.totalsize) QtCore.QThread.terminate(self) @@ -223,6 +227,8 @@ class LiveUSBThread(QtCore.QThread): if self.parent.opts.liveos_checksum: self.live.calculate_liveos_checksum()
+ self.progress.stop() + # Flush all filesystem buffers and unmount self.live.flush_buffers() self.live.unmount_device() @@ -302,12 +308,12 @@ class LiveUSBDialog(QtGui.QDialog, LiveUSBInterface): 'the Properties. Under the Compatibility tab, check the "Run ' 'this program as an administrator" box.'))
- def populate_devices(self, *args, **kw): if self.in_process: return self.driveBox.clear() #self.textEdit.clear() + def add_devices(): if not len(self.live.drives): self.textEdit.setPlainText(_("Unable to find any USB drives"))
commit 7ec0a445fcc2d1453315b0d1f701feec79a2c3a9 Author: Luke Macken lmacken@redhat.com Date: Mon Apr 22 14:46:09 2013 -0400
Enable verbose logging during our tests
diff --git a/tests/test_creator.py b/tests/test_creator.py index 06cfb21..e07c876 100644 --- a/tests/test_creator.py +++ b/tests/test_creator.py @@ -5,7 +5,7 @@ class LiveUSBCreatorOptions(object): force = False safe = False noverify = False - verbose = False + verbose = True
class TestLiveUSBCreator:
commit 9ba8d53cb88f724778e1c3cdb43f43a2b21de857 Author: Luke Macken lmacken@redhat.com Date: Mon Apr 22 14:45:57 2013 -0400
Log exceptions when trying to clean up our processes
diff --git a/liveusb/creator.py b/liveusb/creator.py index e918c38..7c011b0 100755 --- a/liveusb/creator.py +++ b/liveusb/creator.py @@ -743,8 +743,8 @@ class LinuxLiveUSBCreator(LiveUSBCreator): try: os.kill(pid, signal.SIGHUP) self.log.debug("Killed process %d" % pid) - except OSError: - pass + except OSError, e: + self.log.debug(str(e))
def verify_iso_md5(self): """ Verify the ISO md5sum.
commit 089cd2cffa96b8e178d1504cd449323280f2831b Author: Luke Macken lmacken@redhat.com Date: Mon Apr 22 14:45:32 2013 -0400
whitespace tweaks and move an import around
diff --git a/liveusb-creator b/liveusb-creator index dbfe797..e76002a 100755 --- a/liveusb-creator +++ b/liveusb-creator @@ -40,7 +40,7 @@ def parse_args(): parser.add_option('-v', '--verbose', dest='verbose', action='store_true', help='Output extra debugging messages') parser.add_option('-k', '--extra-kernel-args', dest='kernel_args', - action='store', metavar='ARGS', + action='store', metavar='ARGS', help='Supply extra kernel arguments' ' (eg: -k noswap,selinux=0,elevator=noop)') parser.add_option('-x', '--no-xo', dest='xo', action='store_false', diff --git a/liveusb/creator.py b/liveusb/creator.py index 55ce830..e918c38 100755 --- a/liveusb/creator.py +++ b/liveusb/creator.py @@ -29,6 +29,7 @@ import tempfile import logging import hashlib import shutil +import signal import time import os import re @@ -738,7 +739,6 @@ class LinuxLiveUSBCreator(LiveUSBCreator): return dbus.Interface(dev_obj, "org.freedesktop.UDisks.Device")
def terminate(self): - import signal for pid in self.pids: try: os.kill(pid, signal.SIGHUP) diff --git a/tests/test_creator.py b/tests/test_creator.py index 8ac8b09..06cfb21 100644 --- a/tests/test_creator.py +++ b/tests/test_creator.py @@ -92,7 +92,7 @@ class TestLiveUSBCreator: from glob import glob live = self._get_creator() live.detect_removable_drives() - isos = filter(lambda x: x.endswith('.iso'), + isos = filter(lambda x: x.endswith('.iso'), filter(os.path.isfile, glob('*') + glob('*/*'))) assert isos, "No ISOs found. Put one in this directory" for drive in live.drives:
commit 6842dd9d2abe47e4fe53699ae692c69c7e460b65 Author: Luke Macken lmacken@redhat.com Date: Mon Apr 22 14:44:40 2013 -0400
Update the copyright
diff --git a/liveusb-creator b/liveusb-creator index 33e2ee6..dbfe797 100755 --- a/liveusb-creator +++ b/liveusb-creator @@ -1,7 +1,7 @@ #!/usr/bin/python -tt # coding: utf-8 # -# Copyright © 2008-2010 Red Hat, Inc. All rights reserved. +# Copyright © 2008-2013 Red Hat, Inc. All rights reserved. # # This copyrighted material is made available to anyone wishing to use, modify, # copy, or redistribute it subject to the terms and conditions of the GNU
commit 31d068c55546c889353ba57f2cc422a24735ad8f Author: Luke Macken lmacken@redhat.com Date: Fri Mar 1 17:14:21 2013 -0500
More improvements to the maximum overlay size code
diff --git a/liveusb/gui.py b/liveusb/gui.py index 537f141..fb0d677 100755 --- a/liveusb/gui.py +++ b/liveusb/gui.py @@ -50,6 +50,7 @@ except:
MAX_FAT16 = 2047 MAX_FAT32 = 3999 +MAX_EXT = 2097152
class LiveUSBApp(QtGui.QApplication): @@ -400,7 +401,8 @@ class LiveUSBDialog(QtGui.QDialog, LiveUSBInterface): return
device = self.live.drives[drive] - freespace = device['free'] or 0 + freespace = device['free'] + device_size = device['size'] / 1024**2 current_overlay = self.overlaySlider.value()
if device['fsversion'] == 'FAT32': @@ -412,21 +414,23 @@ class LiveUSBDialog(QtGui.QDialog, LiveUSBInterface): 'size to 2G')) max_space = MAX_FAT16 else: - max_space = freespace + max_space = MAX_EXT + + if freespace: + if freespace > device_size: + freespace = device_size + if freespace > max_space: + freespace = max_space
if not device['mount']: self.live.log.warning(_('Device is not yet mounted, so we cannot ' 'determine the amount of free space.')) - if freespace > max_space: - freespace = max_space + if not freespace: + freespace = device_size else: if not freespace: self.live.log.warning(_('No free space on %s') % drive) freespace = 0 - else: - if device['fsversion'] in ('FAT32', 'FAT16'): - if freespace > max_space: - freespace = max_space
# Subtract the size of the ISO from our maximum overlay size if self.live.isosize:
commit 4d6ff60d4dd03f298d2ecdee5cc8aa610e0299d0 Author: Luke Macken lmacken@redhat.com Date: Fri Mar 1 13:52:56 2013 -0500
Get persistent overlays working with F18 (#908120)
diff --git a/liveusb/creator.py b/liveusb/creator.py index 7f34ab6..55ce830 100755 --- a/liveusb/creator.py +++ b/liveusb/creator.py @@ -280,12 +280,21 @@ class LiveUSBCreator(object): line) if "isolinux" in line: line = re.sub("isolinux", "syslinux", line) - if self.overlay and "liveimg" in line: - line = line.replace("liveimg", "liveimg overlay=" + usblabel) - line = line.replace(" ro ", " rw ") - if self.opts.kernel_args: - line = line.replace("liveimg", "liveimg %s" % - ' '.join(self.opts.kernel_args.split(','))) + if "liveimg" in line: + if self.overlay: + line = line.replace("liveimg", "liveimg overlay=" + usblabel) + line = line.replace(" ro ", " rw ") + if self.opts.kernel_args: + line = line.replace("liveimg", "liveimg %s" % + ' '.join(self.opts.kernel_args.split(','))) + elif "rd.live.image" in line: + if self.overlay: + line = line.replace("rd.live.image", "rd.live.image " + + "rd.live.overlay=" + usblabel) + line = line.replace(" ro ", " rw ") + if self.opts.kernel_args: + line = line.replace("rd.live.image", "rd.live.image %s" % + ' '.join(self.opts.kernel_args.split(','))) outfile.write(line) infile.close() outfile.close()
commit 3081589a0356eb239892f8854bc0255d9a584db4 Author: Luke Macken lmacken@redhat.com Date: Fri Mar 1 13:12:55 2013 -0500
Handle devices without any free space
diff --git a/liveusb/gui.py b/liveusb/gui.py index 946f339..537f141 100755 --- a/liveusb/gui.py +++ b/liveusb/gui.py @@ -400,7 +400,7 @@ class LiveUSBDialog(QtGui.QDialog, LiveUSBInterface): return
device = self.live.drives[drive] - freespace = device['free'] + freespace = device['free'] or 0 current_overlay = self.overlaySlider.value()
if device['fsversion'] == 'FAT32':
commit 866397b01d7614d3bce03bdd37e13e5e93cc2bab Author: Luke Macken lmacken@redhat.com Date: Fri Mar 1 12:17:14 2013 -0500
Fix another bug with non-ascii device labels (#863064)
diff --git a/liveusb/gui.py b/liveusb/gui.py index 98d0e1e..946f339 100755 --- a/liveusb/gui.py +++ b/liveusb/gui.py @@ -385,9 +385,9 @@ class LiveUSBDialog(QtGui.QDialog, LiveUSBInterface): 2gigs of free space, set the maximum to 2047mb, which is apparently the largest file we can/should store on a vfat partition. """ - if not str(drive): + if not unicode(drive): return - self._refresh_overlay_slider(str(drive).split()[0]) + self._refresh_overlay_slider(unicode(drive).split()[0])
def _refresh_overlay_slider(self, drive=None): """
commit 9c2d2655a0732127ccc93f9e97446cdb02877a6e Author: Luke Macken lmacken@redhat.com Date: Fri Mar 1 12:07:24 2013 -0500
Handle integers in LiveUSBDialog.status (#820809)
diff --git a/liveusb/gui.py b/liveusb/gui.py index 1842834..98d0e1e 100755 --- a/liveusb/gui.py +++ b/liveusb/gui.py @@ -453,6 +453,8 @@ class LiveUSBDialog(QtGui.QDialog, LiveUSBInterface): def status(self, text): if isinstance(text, Exception): text = text.args[0] + elif isinstance(text, int): + text = str(text) self.textEdit.append(text)
def enable_widgets(self, enabled=True):
commit b4b27d8e6cfe23dcaa3d2b02353c19386903125f Author: Luke Macken lmacken@redhat.com Date: Fri Mar 1 11:50:38 2013 -0500
Don't display unnecessary warnings (#804)
diff --git a/liveusb/gui.py b/liveusb/gui.py index b387d65..1842834 100755 --- a/liveusb/gui.py +++ b/liveusb/gui.py @@ -501,7 +501,7 @@ class LiveUSBDialog(QtGui.QDialog, LiveUSBInterface): if self.opts.reset_mbr: self.live.reset_mbr() else: - self.status(_("Warning: The Master Boot Record on your device " + self.live.log.warn(_("Warning: The Master Boot Record on your device " "does not match your system's syslinux MBR. If you " "have trouble booting this stick, try running the " "liveusb-creator with the --reset-mbr option."))
commit ed1610282fa91512884e471e95fd688439e47390 Author: Luke Macken lmacken@redhat.com Date: Fri Mar 1 11:42:30 2013 -0500
Handle non-ascii mount paths (#802)
diff --git a/liveusb/creator.py b/liveusb/creator.py index 8dbf2d3..7f34ab6 100755 --- a/liveusb/creator.py +++ b/liveusb/creator.py @@ -456,7 +456,7 @@ class LinuxLiveUSBCreator(LiveUSBCreator): 'fsversion': str(dev.Get(device, 'IdVersion')), 'uuid': str(dev.Get(device, 'IdUuid')), 'device': str(dev.Get(device, 'DeviceFile')), - 'mount': map(str, list(dev.Get(device, 'DeviceMountPaths'))), + 'mount': map(unicode, list(dev.Get(device, 'DeviceMountPaths'))), 'bootable': 'boot' in map(str, list(dev.Get(device, 'PartitionFlags'))), 'parent': None,
commit 25aca6ce22eca501e832740932b28a748e8b645a Author: Luke Macken lmacken@redhat.com Date: Fri Mar 1 11:28:15 2013 -0500
Limit the overlay size to 3999MB for FAT32 (#619)
diff --git a/liveusb/gui.py b/liveusb/gui.py index eb6af73..b387d65 100755 --- a/liveusb/gui.py +++ b/liveusb/gui.py @@ -48,6 +48,9 @@ try: except: pass
+MAX_FAT16 = 2047 +MAX_FAT32 = 3999 +
class LiveUSBApp(QtGui.QApplication): """ Main application class """ @@ -400,27 +403,36 @@ class LiveUSBDialog(QtGui.QDialog, LiveUSBInterface): freespace = device['free'] current_overlay = self.overlaySlider.value()
+ if device['fsversion'] == 'FAT32': + self.live.log.warning(_('Partition is FAT32; Restricting overlay ' + 'size to 4G')) + max_space = MAX_FAT32 + elif device['fsversion'] == 'FAT16': + self.live.log.warning(_('Partition is FAT16; Restricting overlay ' + 'size to 2G')) + max_space = MAX_FAT16 + else: + max_space = freespace + if not device['mount']: self.live.log.warning(_('Device is not yet mounted, so we cannot ' - 'determine the amount of free space. ' - 'Setting a maximum limit of 8G for the ' - 'persistent storage.')) - freespace = 8192 + 'determine the amount of free space.')) + if freespace > max_space: + freespace = max_space else: if not freespace: self.live.log.warning(_('No free space on %s') % drive) freespace = 0 - - # FAT16 cannot handle files greater than 2G - if device['fsversion'] == 'FAT16': - self.live.log.warning(_('Partition is FAT16; Restricting overlay ' - 'size to 2G')) - if freespace > 2047: - freespace = 2047 + else: + if device['fsversion'] in ('FAT32', 'FAT16'): + if freespace > max_space: + freespace = max_space
# Subtract the size of the ISO from our maximum overlay size if self.live.isosize: - freespace -= self.live.isosize / 1024**2 + iso_size = self.live.isosize / 1024**2 + if freespace + iso_size > device['free']: + freespace -= iso_size
freespace -= 1 # Don't fill the device 100%
commit 30a87a0694e5c1bad792b7115d8216a2f953384c Author: Luke Macken lmacken@redhat.com Date: Fri Mar 1 11:26:25 2013 -0500
Change isolinux to syslinux in the grub.cfg (#810112)
diff --git a/liveusb/creator.py b/liveusb/creator.py index f6bd5e0..8dbf2d3 100755 --- a/liveusb/creator.py +++ b/liveusb/creator.py @@ -278,6 +278,8 @@ class LiveUSBCreator(object): line = re.sub("rootfstype=[^ ]*", "rootfstype=%s" % self.fstype, line) + if "isolinux" in line: + line = re.sub("isolinux", "syslinux", line) if self.overlay and "liveimg" in line: line = line.replace("liveimg", "liveimg overlay=" + usblabel) line = line.replace(" ro ", " rw ")
commit 10f4fb3b82e081b835e268713f76c55026bb131f Author: Luke Macken lmacken@redhat.com Date: Fri Mar 1 11:25:54 2013 -0500
Always refer to the label LIVE instead of the device UUID (#809)
diff --git a/liveusb/creator.py b/liveusb/creator.py index 881c90b..f6bd5e0 100755 --- a/liveusb/creator.py +++ b/liveusb/creator.py @@ -271,10 +271,10 @@ class LiveUSBCreator(object): def _update_configs(self, infile, outfile): infile = file(infile, 'r') outfile= file(outfile, 'w') - usblabel = self.uuid and 'UUID=' + self.uuid or 'LABEL=' + self.label + usblabel = 'LABEL=' + self.label for line in infile.readlines(): - if "CDLABEL" in line: - line = re.sub("CDLABEL=[^ ]*", usblabel, line) + if "LABEL" in line: + line = re.sub("LABEL=[^ ]*", usblabel, line) line = re.sub("rootfstype=[^ ]*", "rootfstype=%s" % self.fstype, line)
commit 18ed6caff4ed9804d53e9bde6fc1481bd5ee00c1 Author: Luke Macken lmacken@redhat.com Date: Fri Mar 1 11:24:54 2013 -0500
/EFI/boot/grub.conf has been renamed to /EFI/BOOT/grub.cfg
diff --git a/liveusb/creator.py b/liveusb/creator.py index 6dae7b0..881c90b 100755 --- a/liveusb/creator.py +++ b/liveusb/creator.py @@ -290,10 +290,10 @@ class LiveUSBCreator(object):
def update_configs(self): """ Generate our syslinux.cfg and grub.conf files """ - grubconf = os.path.join(self.dest, "EFI", "boot", "grub.conf") - bootconf = os.path.join(self.dest, "EFI", "boot", "boot.conf") - bootx64conf = os.path.join(self.dest, "EFI", "boot", "bootx64.conf") - bootia32conf = os.path.join(self.dest, "EFI", "boot", "bootia32.conf") + grubconf = os.path.join(self.dest, "EFI", "BOOT", "grub.cfg") + bootconf = os.path.join(self.dest, "EFI", "BOOT", "boot.conf") + bootx64conf = os.path.join(self.dest, "EFI", "BOOT", "bootx64.conf") + bootia32conf = os.path.join(self.dest, "EFI", "BOOT", "bootia32.conf") updates = [(os.path.join(self.dest, "isolinux", "isolinux.cfg"), os.path.join(self.dest, "isolinux", "syslinux.cfg")), (grubconf, bootconf)]
commit 19c25589f0407802713bced428fb9794abf7dbcc Author: Luke Macken lmacken@redhat.com Date: Fri Mar 1 08:44:31 2013 -0500
whitespace fixes
diff --git a/liveusb/creator.py b/liveusb/creator.py index fcbf302..6dae7b0 100755 --- a/liveusb/creator.py +++ b/liveusb/creator.py @@ -118,7 +118,7 @@ class LiveUSBCreator(object):
Platform-specific classes inheriting from the LiveUSBCreator are expected to implement this method to install the bootloader to the - specified device using syslinux. This specific implemention is + specified device using syslinux. This specific implemention is platform independent and performs sanity checking along with adding OLPC support. """ @@ -251,7 +251,7 @@ class LiveUSBCreator(object): self.log.debug('overlaysize = %d' % overlaysize) self.totalsize = overlaysize + self.isosize if self.totalsize > freebytes: - raise LiveUSBError(_("Not enough free space on device." + + raise LiveUSBError(_("Not enough free space on device." + "\n%dMB ISO + %dMB overlay > %dMB free space" % (self.isosize/1024**2, self.overlay, freebytes/1024**2))) @@ -303,7 +303,7 @@ class LiveUSBCreator(object):
for (infile, outfile) in updates: if os.path.exists(infile): - self._update_configs(infile,outfile) + self._update_configs(infile, outfile) # only copy/overwrite files we had originally started with for (infile, outfile) in copies: if os.path.exists(outfile): @@ -341,7 +341,7 @@ class LiveUSBCreator(object): out.write(self.output.getvalue()) out.close() return filename - +
def existing_liveos(self): return os.path.exists(self.get_liveos()) @@ -738,7 +738,7 @@ class LinuxLiveUSBCreator(LiveUSBCreator): def verify_iso_md5(self): """ Verify the ISO md5sum.
- At the moment this is Linux specific, until we port checkisomd5 + At the moment this is Linux specific, until we port checkisomd5 to Windows. """ self.log.info(_('Verifying ISO MD5 checksum')) @@ -1008,7 +1008,7 @@ class WindowsLiveUSBCreator(LiveUSBCreator): if delta.seconds: self.mb_per_sec = (self.isosize / delta.seconds) / 1024**2 if self.mb_per_sec: - self.log.info(_("Wrote to device at") + " %d MB/sec" % + self.log.info(_("Wrote to device at") + " %d MB/sec" % self.mb_per_sec)
def install_bootloader(self):
commit 3c7d9b728ba080edc3eb0ffb33ca3c0aae175962 Author: Luke Macken lmacken@redhat.com Date: Fri Mar 1 08:44:03 2013 -0500
Update the copyright
diff --git a/liveusb/creator.py b/liveusb/creator.py index bec1ecf..fcbf302 100755 --- a/liveusb/creator.py +++ b/liveusb/creator.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # -# Copyright © 2008-2010 Red Hat, Inc. All rights reserved. -# Copyright © 2008-2010 Luke Macken lmacken@redhat.com +# Copyright © 2008-2013 Red Hat, Inc. All rights reserved. +# Copyright © 2008-2013 Luke Macken lmacken@redhat.com # # This copyrighted material is made available to anyone wishing to use, modify, # copy, or redistribute it subject to the terms and conditions of the GNU
commit 85d39a71f7caa6f4f5c5ae5bb20bc4ee80b87d6d Merge: 6d2f545 ee1c89b Author: Luke Macken lmacken@redhat.com Date: Tue Jan 15 13:31:36 2013 -0500
Merge branch 'release/3.11.8' into develop
commit ee1c89bcd7f9a7985fe15533f95a1a7793277988 Author: Luke Macken lmacken@redhat.com Date: Tue Jan 15 13:31:18 2013 -0500
Bump version to 3.11.8
diff --git a/liveusb-creator b/liveusb-creator index e3f230c..33e2ee6 100755 --- a/liveusb-creator +++ b/liveusb-creator @@ -23,7 +23,7 @@ import sys
from liveusb import _
-__version__ = '3.11.7' +__version__ = '3.11.8'
def parse_args(): from optparse import OptionParser diff --git a/liveusb-creator.spec b/liveusb-creator.spec index 9ce87ce..b03a2fb 100644 --- a/liveusb-creator.spec +++ b/liveusb-creator.spec @@ -1,7 +1,7 @@ %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
Name: liveusb-creator -Version: 3.11.7 +Version: 3.11.8 Release: 1%{?dist} Summary: A liveusb creator
@@ -68,6 +68,9 @@ rm -rf %{buildroot} %config(noreplace) %{_sysconfdir}/security/console.apps/%{name}
%changelog +* Tue Jan 15 2013 Luke Macken lmacken@redhat.com - 3.11.8-1 +- Update to 3.11.8 + * Tue Nov 08 2011 Luke Macken lmacken@redhat.com - 3.11.6-1 - Update our release list for F16
diff --git a/setup.py b/setup.py index fff8ae5..7d0b526 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from distutils.core import setup import sys, os
-VERSION = '3.11.7' +VERSION = '3.11.8'
LOCALE_DIR= '/usr/share/locale'
commit 6d2f5450a364ef73c8488d1f71759cc5f790e91b Author: Luke Macken lmacken@redhat.com Date: Tue Jan 15 12:43:38 2013 -0500
Apply a patch from ivanromanov to fix non-ascii file names ([ticket:631])
diff --git a/liveusb/creator.py b/liveusb/creator.py index 345b51a..bec1ecf 100755 --- a/liveusb/creator.py +++ b/liveusb/creator.py @@ -32,6 +32,7 @@ import shutil import time import os import re +import sys
from StringIO import StringIO from datetime import datetime @@ -181,7 +182,7 @@ class LiveUSBCreator(object): """ self.log.debug(cmd) if isinstance(cmd, unicode): - cmd = cmd.encode('utf-8', 'replace') + cmd = cmd.encode(sys.getfilesystemencoding(), 'replace') self.output.write(cmd) proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE,
commit 71c9e1d47c36581fee1f4f42c27febee772737a4 Author: Luke Macken lmacken@redhat.com Date: Tue Jan 15 12:27:10 2013 -0500
Enable the close button (issue #3)
diff --git a/liveusb/gui.py b/liveusb/gui.py index 95a6ff4..eb6af73 100755 --- a/liveusb/gui.py +++ b/liveusb/gui.py @@ -262,6 +262,7 @@ class LiveUSBDialog(QtGui.QDialog, LiveUSBInterface): self.in_process = False QtGui.QDialog.__init__(self) LiveUSBInterface.__init__(self) + self.setWindowFlags(QtCore.Qt.WindowCloseButtonHint) self.opts = opts self.args = args self.setupUi(self) @@ -334,6 +335,7 @@ class LiveUSBDialog(QtGui.QDialog, LiveUSBInterface): self.live.log.info(_('Releases updated!'))
def connect_slots(self): + self.connect(self, QtCore.SIGNAL('triggered()'), self.terminate) self.connect(self.isoBttn, QtCore.SIGNAL("clicked()"), self.selectfile) self.connect(self.startButton, QtCore.SIGNAL("clicked()"), self.begin) self.connect(self.overlaySlider, QtCore.SIGNAL("valueChanged(int)"),
commit e2ad6b4489756271f47d2b72948c57240e8d3dd9 Author: Luke Macken lmacken@redhat.com Date: Tue Jan 15 12:27:05 2013 -0500
Update the copyright
diff --git a/liveusb/gui.py b/liveusb/gui.py index e568fea..95a6ff4 100755 --- a/liveusb/gui.py +++ b/liveusb/gui.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # -# Copyright © 2008-2010 Red Hat, Inc. All rights reserved. -# Copyright © 2008-2010 Luke Macken lmacken@redhat.com +# Copyright © 2008-2013 Red Hat, Inc. All rights reserved. +# Copyright © 2008-2013 Luke Macken lmacken@redhat.com # Copyright © 2008 Kushal Das kushal@fedoraproject.org # # This copyrighted material is made available to anyone wishing to use, modify,
commit c45d28249c5b3a89d5624a76b37c1d9bd300f0ed Author: Luke Macken lmacken@redhat.com Date: Tue Jan 15 12:14:17 2013 -0500
Add f18 to our hardcoded release list
diff --git a/liveusb/releases.py b/liveusb/releases.py index 080ff21..b483d7b 100644 --- a/liveusb/releases.py +++ b/liveusb/releases.py @@ -7,6 +7,18 @@ ARCHES = ('i386', 'i686', 'x86_64')
# A backup list of releases, just in case we can't fetch them. fedora_releases = [ + {'name': 'Fedora 18 i686 Desktop', + 'sha256': '7c7f453c15a5d13df95bf8caab6277e5aab1c6353eb242b1cf00344b61869d26', + 'url': 'http://dl.fedoraproject.org/pub/fedora/linux/releases/18/Live/i386/Fedora-18..., + {'name': 'Fedora 18 i686 KDE', + 'sha256': 'f172192566d0e12c29a741a568a917c5d8643aa781fdf06598b12a217a58cb74', + 'url': 'http://dl.fedoraproject.org/pub/fedora/linux/releases/18/Live/i386/Fedora-18..., + {'name': 'Fedora 18 x86_64 Desktop', + 'sha256': 'a276e06d244e04b765f0a35532d9036ad84f340b0bdcc32e0233a8fbc31d5bed', + 'url': 'http://dl.fedoraproject.org/pub/fedora/linux/releases/18/Live/x86_64/Fedora-..., + {'name': 'Fedora 18 x86_64 KDE', + 'sha256': '41d51d86ff5c272263285d00a0c3da7acbbce404b9930b0ff8bd7226e7248805', + 'url': 'http://dl.fedoraproject.org/pub/fedora/linux/releases/18/Live/x86_64/Fedora-..., {'name': 'Fedora 17 i686 Desktop', 'sha256': '26027f4d4686f1df186b31ce773dbb903db18f4b1aa37a1e37f0fa6ff4111f42', 'url': 'http://dl.fedoraproject.org/pub/fedora/linux/releases/17/Live/i686/Fedora-17...,
commit fe8266b0757b4ebdc662aa2ec93b06a02bbba425 Author: Luke Macken lmacken@redhat.com Date: Tue Jan 15 12:12:29 2013 -0500
Add a button for refreshing the list of releases
diff --git a/data/liveusb-creator.ui b/data/liveusb-creator.ui index f2c2c48..2623ff8 100755 --- a/data/liveusb-creator.ui +++ b/data/liveusb-creator.ui @@ -1,7 +1,8 @@ -<ui version="4.0" > +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> <class>Dialog</class> - <widget class="QDialog" name="Dialog" > - <property name="geometry" > + <widget class="QDialog" name="Dialog"> + <property name="geometry"> <rect> <x>0</x> <y>0</y> @@ -9,20 +10,20 @@ <height>388</height> </rect> </property> - <property name="sizePolicy" > - <sizepolicy vsizetype="Fixed" hsizetype="Fixed" > + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="windowTitle" > + <property name="windowTitle"> <string>Fedora LiveUSB Creator</string> </property> - <widget class="QPushButton" name="startButton" > - <property name="enabled" > + <widget class="QPushButton" name="startButton"> + <property name="enabled"> <bool>true</bool> </property> - <property name="geometry" > + <property name="geometry"> <rect> <x>130</x> <y>350</y> @@ -30,15 +31,15 @@ <height>34</height> </rect> </property> - <property name="whatsThis" > + <property name="whatsThis"> <string>This button will begin the LiveUSB creation process. This entails optionally downloading a release (if an existing one wasn't selected), extracting the ISO to the USB device, creating the persistent overlay, and installing the bootloader.</string> </property> - <property name="text" > + <property name="text"> <string>Create Live USB</string> </property> </widget> - <widget class="QTextEdit" name="textEdit" > - <property name="geometry" > + <widget class="QTextEdit" name="textEdit"> + <property name="geometry"> <rect> <x>10</x> <y>200</y> @@ -46,20 +47,20 @@ <height>111</height> </rect> </property> - <property name="font" > + <property name="font"> <font> <pointsize>8</pointsize> </font> </property> - <property name="whatsThis" > + <property name="whatsThis"> <string>This is the status console, where all messages get written to.</string> </property> - <property name="readOnly" > + <property name="readOnly"> <bool>true</bool> </property> </widget> - <widget class="QProgressBar" name="progressBar" > - <property name="geometry" > + <widget class="QProgressBar" name="progressBar"> + <property name="geometry"> <rect> <x>10</x> <y>320</y> @@ -67,15 +68,15 @@ <height>23</height> </rect> </property> - <property name="whatsThis" > + <property name="whatsThis"> <string>This is the progress bar that will indicate how far along in the LiveUSB creation process you are</string> </property> - <property name="value" > + <property name="value"> <number>0</number> </property> </widget> - <widget class="QGroupBox" name="downloadGroup" > - <property name="geometry" > + <widget class="QGroupBox" name="downloadGroup"> + <property name="geometry"> <rect> <x>210</x> <y>80</y> @@ -83,30 +84,50 @@ <height>51</height> </rect> </property> - <property name="font" > + <property name="font"> <font> <pointsize>8</pointsize> </font> </property> - <property name="whatsThis" > + <property name="whatsThis"> <string>If you do not select an existing Live CD, the selected release will be downloaded for you.</string> </property> - <property name="title" > + <property name="title"> <string>Download Fedora</string> </property> - <widget class="QComboBox" name="downloadCombo" > - <property name="geometry" > + <widget class="QComboBox" name="downloadCombo"> + <property name="geometry"> <rect> <x>10</x> <y>20</y> - <width>181</width> + <width>161</width> <height>22</height> </rect> </property> </widget> + <widget class="QPushButton" name="refreshReleasesButton"> + <property name="geometry"> + <rect> + <x>170</x> + <y>20</y> + <width>30</width> + <height>20</height> + </rect> + </property> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset resource="resources.qrc"> + <normaloff>:/refresh.png</normaloff>:/refresh.png</iconset> + </property> + <property name="flat"> + <bool>true</bool> + </property> + </widget> </widget> - <widget class="QLabel" name="label_2" > - <property name="geometry" > + <widget class="QLabel" name="label_2"> + <property name="geometry"> <rect> <x>180</x> <y>100</y> @@ -114,7 +135,7 @@ <height>24</height> </rect> </property> - <property name="font" > + <property name="font"> <font> <family>Verdana</family> <pointsize>10</pointsize> @@ -122,12 +143,12 @@ <bold>true</bold> </font> </property> - <property name="text" > + <property name="text"> <string>or</string> </property> </widget> - <widget class="QGroupBox" name="groupBox" > - <property name="geometry" > + <widget class="QGroupBox" name="groupBox"> + <property name="geometry"> <rect> <x>10</x> <y>80</y> @@ -135,19 +156,19 @@ <height>51</height> </rect> </property> - <property name="font" > + <property name="font"> <font> <pointsize>8</pointsize> </font> </property> - <property name="whatsThis" > + <property name="whatsThis"> <string>This button allows you to browse for an existing Live CD ISO that you have previously downloaded. If you do not select one, a release will be downloaded for you automatically.</string> </property> - <property name="title" > + <property name="title"> <string>Use existing Live CD</string> </property> - <widget class="QPushButton" name="isoBttn" > - <property name="geometry" > + <widget class="QPushButton" name="isoBttn"> + <property name="geometry"> <rect> <x>11</x> <y>18</y> @@ -155,16 +176,16 @@ <height>25</height> </rect> </property> - <property name="text" > + <property name="text"> <string>Browse</string> </property> - <property name="shortcut" > + <property name="shortcut"> <string>Alt+B</string> </property> </widget> </widget> - <widget class="QGroupBox" name="groupBox_2" > - <property name="geometry" > + <widget class="QGroupBox" name="groupBox_2"> + <property name="geometry"> <rect> <x>10</x> <y>140</y> @@ -172,58 +193,59 @@ <height>51</height> </rect> </property> - <property name="font" > + <property name="font"> <font> <pointsize>8</pointsize> </font> </property> - <property name="whatsThis" > + <property name="whatsThis"> <string>This is the USB stick that you want to install your Live CD on. This device must be formatted with the FAT filesystem.</string> </property> - <property name="title" > + <property name="title"> <string>Target Device</string> </property> - <widget class="QComboBox" name="driveBox" > - <property name="geometry" > + <widget class="QComboBox" name="driveBox"> + <property name="geometry"> <rect> <x>10</x> <y>20</y> - <width>145</width> - <height>20</height> + <width>151</width> + <height>21</height> </rect> </property> - <property name="editable" > + <property name="editable"> <bool>false</bool> </property> - <property name="insertPolicy" > + <property name="insertPolicy"> <enum>QComboBox::InsertAtTop</enum> </property> - <property name="duplicatesEnabled" > + <property name="duplicatesEnabled"> <bool>false</bool> </property> </widget> - <widget class="QPushButton" name="refreshDevicesButton" > - <property name="geometry" > + <widget class="QPushButton" name="refreshDevicesButton"> + <property name="geometry"> <rect> - <x>156</x> - <y>16</y> + <x>160</x> + <y>20</y> <width>30</width> - <height>26</height> + <height>20</height> </rect> </property> - <property name="text" > + <property name="text"> <string/> </property> - <property name="icon" > - <iconset resource="resources.qrc" >:/refresh.png</iconset> + <property name="icon"> + <iconset resource="resources.qrc"> + <normaloff>:/refresh.png</normaloff>:/refresh.png</iconset> </property> - <property name="flat" > + <property name="flat"> <bool>true</bool> </property> </widget> </widget> - <widget class="QGroupBox" name="overlayTitle" > - <property name="geometry" > + <widget class="QGroupBox" name="overlayTitle"> + <property name="geometry"> <rect> <x>210</x> <y>140</y> @@ -231,19 +253,19 @@ <height>51</height> </rect> </property> - <property name="font" > + <property name="font"> <font> <pointsize>8</pointsize> </font> </property> - <property name="whatsThis" > - <string comment="comment!" >By allocating extra space on your USB stick for a persistent overlay, you will be able to store data and make permanent modifications to your live operating system. Without it, you will not be able to save data that will persist after a reboot.</string> + <property name="whatsThis"> + <string comment="comment!">By allocating extra space on your USB stick for a persistent overlay, you will be able to store data and make permanent modifications to your live operating system. Without it, you will not be able to save data that will persist after a reboot.</string> </property> - <property name="title" > + <property name="title"> <string>Persistent Storage (0 MB)</string> </property> - <widget class="QSlider" name="overlaySlider" > - <property name="geometry" > + <widget class="QSlider" name="overlaySlider"> + <property name="geometry"> <rect> <x>10</x> <y>20</y> @@ -251,19 +273,19 @@ <height>21</height> </rect> </property> - <property name="maximum" > + <property name="maximum"> <number>2047</number> </property> - <property name="orientation" > + <property name="orientation"> <enum>Qt::Horizontal</enum> </property> - <property name="tickPosition" > + <property name="tickPosition"> <enum>QSlider::NoTicks</enum> </property> </widget> </widget> - <widget class="QLabel" name="label" > - <property name="geometry" > + <widget class="QLabel" name="label"> + <property name="geometry"> <rect> <x>0</x> <y>0</y> @@ -271,16 +293,16 @@ <height>72</height> </rect> </property> - <property name="text" > + <property name="text"> <string/> </property> - <property name="pixmap" > - <pixmap resource="resources.qrc" >:/liveusb-header.png</pixmap> + <property name="pixmap"> + <pixmap resource="resources.qrc">:/liveusb-header.png</pixmap> </property> </widget> </widget> <resources> - <include location="resources.qrc" /> + <include location="resources.qrc"/> </resources> <connections/> </ui> diff --git a/liveusb/gui.py b/liveusb/gui.py index 9d1850b..e568fea 100755 --- a/liveusb/gui.py +++ b/liveusb/gui.py @@ -34,7 +34,7 @@ from datetime import datetime from PyQt4 import QtCore, QtGui
from liveusb import LiveUSBCreator, LiveUSBError, LiveUSBInterface, _ -from liveusb.releases import releases +from liveusb.releases import releases, get_fedora_releases if sys.platform == 'win32': from liveusb.urlgrabber.grabber import URLGrabber, URLGrabError from liveusb.urlgrabber.progress import BaseMeter @@ -52,7 +52,7 @@ except: class LiveUSBApp(QtGui.QApplication): """ Main application class """ def __init__(self, opts, args): - QtGui.QApplication.__init__(self, args) + QtGui.QApplication.__init__(self, args) self.mywindow = LiveUSBDialog(opts, args) self.mywindow.show() try: @@ -118,7 +118,7 @@ class DownloadProgress(QtCore.QObject, BaseMeter): class ProgressThread(QtCore.QThread): """ A thread that monitors the progress of Live USB creation.
- This thread periodically checks the amount of free space left on the + This thread periodically checks the amount of free space left on the given drive and sends a signal to our main dialog window to update the progress bar. """ @@ -182,7 +182,7 @@ class LiveUSBThread(QtCore.QThread):
self.live.verify_filesystem() if not self.live.drive['uuid'] and not self.live.label: - self.status(_("Error: Cannot set the label or obtain " + self.status(_("Error: Cannot set the label or obtain " "the UUID of your device. Unable to continue.")) self.live.log.removeHandler(handler) return @@ -325,6 +325,14 @@ class LiveUSBDialog(QtGui.QDialog, LiveUSBInterface): for release in [release['name'] for release in releases]: self.downloadCombo.addItem(release)
+ def refresh_releases(self): + self.live.log.info(_('Refreshing releases...')) + fedora_releases = get_fedora_releases() + self.downloadCombo.clear() + for release in [release['name'] for release in fedora_releases]: + self.downloadCombo.addItem(release) + self.live.log.info(_('Releases updated!')) + def connect_slots(self): self.connect(self.isoBttn, QtCore.SIGNAL("clicked()"), self.selectfile) self.connect(self.startButton, QtCore.SIGNAL("clicked()"), self.begin) @@ -351,6 +359,9 @@ class LiveUSBDialog(QtGui.QDialog, LiveUSBInterface): if hasattr(self, 'refreshDevicesButton'): self.connect(self.refreshDevicesButton, QtCore.SIGNAL("clicked()"), self.populate_devices) + if hasattr(self, 'refreshReleasesButton'): + self.connect(self.refreshReleasesButton, QtCore.SIGNAL("clicked()"), + self.refresh_releases)
# If we have access to HAL & DBus, intercept some useful signals if hasattr(self.live, 'udisks'): @@ -438,6 +449,8 @@ class LiveUSBDialog(QtGui.QDialog, LiveUSBInterface): self.downloadCombo.setEnabled(enabled) if hasattr(self, 'refreshDevicesButton'): self.refreshDevicesButton.setEnabled(enabled) + if hasattr(self, 'refreshReleasesButton'): + self.refreshReleasesButton.setEnabled(enabled) self.in_process = not enabled
def overlay_value(self, value): @@ -506,7 +519,7 @@ class LiveUSBDialog(QtGui.QDialog, LiveUSBInterface): return else: # The user has confirmed that they wish to overwrite their - # existing Live OS. Here we delete it first, in order to + # existing Live OS. Here we delete it first, in order to # accurately calculate progress. self.confirmed = False try: @@ -566,7 +579,7 @@ class LiveUSBDialog(QtGui.QDialog, LiveUSBInterface): "You may have better luck if you move your ISO " "to the root of your drive (ie: C:)"))
- self.live.log.info('%s ' % os.path.basename(self.live.iso) + + self.live.log.info('%s ' % os.path.basename(self.live.iso) + _("selected")) self._refresh_overlay_slider()
diff --git a/liveusb/linux_dialog.py b/liveusb/linux_dialog.py index 38e039e..754af54 100644 --- a/liveusb/linux_dialog.py +++ b/liveusb/linux_dialog.py @@ -1,19 +1,32 @@ # -*- coding: utf-8 -*-
-# Form implementation generated from reading ui file 'data/liveusb-creator-linux.ui' +# Form implementation generated from reading ui file 'data/liveusb-creator.ui' # -# Created: Mon Dec 29 19:22:24 2008 -# by: PyQt4 UI code generator 4.4.3 +# Created: Tue Jan 15 12:09:54 2013 +# by: PyQt4 UI code generator 4.9.6 # # WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui -from liveusb import _ + +try: + _fromUtf8 = QtCore.QString.fromUtf8 +except AttributeError: + def _fromUtf8(s): + return s + +try: + _encoding = QtGui.QApplication.UnicodeUTF8 + def _translate(context, text, disambig): + return QtGui.QApplication.translate(context, text, disambig, _encoding) +except AttributeError: + def _translate(context, text, disambig): + return QtGui.QApplication.translate(context, text, disambig)
class Ui_Dialog(object): def setupUi(self, Dialog): - Dialog.setObjectName("Dialog") - Dialog.resize(430, 388) + Dialog.setObjectName(_fromUtf8("Dialog")) + Dialog.resize(422, 388) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) @@ -21,95 +34,109 @@ class Ui_Dialog(object): Dialog.setSizePolicy(sizePolicy) self.startButton = QtGui.QPushButton(Dialog) self.startButton.setEnabled(True) - self.startButton.setGeometry(QtCore.QRect(112, 348, 209, 34)) - self.startButton.setObjectName("startButton") + self.startButton.setGeometry(QtCore.QRect(130, 350, 158, 34)) + self.startButton.setObjectName(_fromUtf8("startButton")) self.textEdit = QtGui.QTextEdit(Dialog) - self.textEdit.setGeometry(QtCore.QRect(8, 200, 409, 111)) + self.textEdit.setGeometry(QtCore.QRect(10, 200, 401, 111)) font = QtGui.QFont() font.setPointSize(8) self.textEdit.setFont(font) self.textEdit.setReadOnly(True) - self.textEdit.setObjectName("textEdit") + self.textEdit.setObjectName(_fromUtf8("textEdit")) self.progressBar = QtGui.QProgressBar(Dialog) - self.progressBar.setGeometry(QtCore.QRect(10, 320, 405, 23)) - self.progressBar.setProperty("value", QtCore.QVariant(0)) - self.progressBar.setTextVisible(True) - self.progressBar.setObjectName("progressBar") + self.progressBar.setGeometry(QtCore.QRect(10, 320, 401, 23)) + self.progressBar.setProperty("value", 0) + self.progressBar.setObjectName(_fromUtf8("progressBar")) self.downloadGroup = QtGui.QGroupBox(Dialog) - self.downloadGroup.setGeometry(QtCore.QRect(216, 80, 205, 51)) + self.downloadGroup.setGeometry(QtCore.QRect(210, 80, 201, 51)) font = QtGui.QFont() font.setPointSize(8) self.downloadGroup.setFont(font) - self.downloadGroup.setObjectName("downloadGroup") + self.downloadGroup.setObjectName(_fromUtf8("downloadGroup")) self.downloadCombo = QtGui.QComboBox(self.downloadGroup) - self.downloadCombo.setGeometry(QtCore.QRect(8, 20, 189, 25)) - self.downloadCombo.setObjectName("downloadCombo") + self.downloadCombo.setGeometry(QtCore.QRect(10, 20, 161, 22)) + self.downloadCombo.setObjectName(_fromUtf8("downloadCombo")) + self.refreshReleasesButton = QtGui.QPushButton(self.downloadGroup) + self.refreshReleasesButton.setGeometry(QtCore.QRect(170, 20, 30, 20)) + self.refreshReleasesButton.setText(_fromUtf8("")) + icon = QtGui.QIcon() + icon.addPixmap(QtGui.QPixmap(_fromUtf8(":/refresh.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.refreshReleasesButton.setIcon(icon) + self.refreshReleasesButton.setFlat(True) + self.refreshReleasesButton.setObjectName(_fromUtf8("refreshReleasesButton")) self.label_2 = QtGui.QLabel(Dialog) - self.label_2.setGeometry(QtCore.QRect(184, 100, 23, 24)) + self.label_2.setGeometry(QtCore.QRect(180, 100, 23, 24)) font = QtGui.QFont() - font.setFamily("Verdana") + font.setFamily(_fromUtf8("Verdana")) font.setPointSize(10) - font.setWeight(75) font.setBold(True) + font.setWeight(75) self.label_2.setFont(font) - self.label_2.setObjectName("label_2") + self.label_2.setObjectName(_fromUtf8("label_2")) self.groupBox = QtGui.QGroupBox(Dialog) - self.groupBox.setGeometry(QtCore.QRect(12, 80, 161, 51)) + self.groupBox.setGeometry(QtCore.QRect(10, 80, 161, 51)) font = QtGui.QFont() font.setPointSize(8) self.groupBox.setFont(font) - self.groupBox.setObjectName("groupBox") + self.groupBox.setObjectName(_fromUtf8("groupBox")) self.isoBttn = QtGui.QPushButton(self.groupBox) self.isoBttn.setGeometry(QtCore.QRect(11, 18, 141, 25)) - self.isoBttn.setObjectName("isoBttn") + self.isoBttn.setObjectName(_fromUtf8("isoBttn")) self.groupBox_2 = QtGui.QGroupBox(Dialog) - self.groupBox_2.setGeometry(QtCore.QRect(10, 140, 201, 51)) + self.groupBox_2.setGeometry(QtCore.QRect(10, 140, 191, 51)) font = QtGui.QFont() font.setPointSize(8) self.groupBox_2.setFont(font) - self.groupBox_2.setObjectName("groupBox_2") + self.groupBox_2.setObjectName(_fromUtf8("groupBox_2")) self.driveBox = QtGui.QComboBox(self.groupBox_2) - self.driveBox.setGeometry(QtCore.QRect(10, 20, 181, 25)) + self.driveBox.setGeometry(QtCore.QRect(10, 20, 151, 21)) self.driveBox.setEditable(False) self.driveBox.setInsertPolicy(QtGui.QComboBox.InsertAtTop) self.driveBox.setDuplicatesEnabled(False) - self.driveBox.setObjectName("driveBox") + self.driveBox.setObjectName(_fromUtf8("driveBox")) + self.refreshDevicesButton = QtGui.QPushButton(self.groupBox_2) + self.refreshDevicesButton.setGeometry(QtCore.QRect(160, 20, 30, 20)) + self.refreshDevicesButton.setText(_fromUtf8("")) + self.refreshDevicesButton.setIcon(icon) + self.refreshDevicesButton.setFlat(True) + self.refreshDevicesButton.setObjectName(_fromUtf8("refreshDevicesButton")) self.overlayTitle = QtGui.QGroupBox(Dialog) - self.overlayTitle.setGeometry(QtCore.QRect(216, 140, 211, 51)) + self.overlayTitle.setGeometry(QtCore.QRect(210, 140, 201, 51)) font = QtGui.QFont() font.setPointSize(8) self.overlayTitle.setFont(font) - self.overlayTitle.setObjectName("overlayTitle") + self.overlayTitle.setObjectName(_fromUtf8("overlayTitle")) self.overlaySlider = QtGui.QSlider(self.overlayTitle) self.overlaySlider.setGeometry(QtCore.QRect(10, 20, 181, 21)) self.overlaySlider.setMaximum(2047) self.overlaySlider.setOrientation(QtCore.Qt.Horizontal) self.overlaySlider.setTickPosition(QtGui.QSlider.NoTicks) - self.overlaySlider.setObjectName("overlaySlider") + self.overlaySlider.setObjectName(_fromUtf8("overlaySlider")) self.label = QtGui.QLabel(Dialog) - self.label.setGeometry(QtCore.QRect(0, 0, 431, 72)) - self.label.setPixmap(QtGui.QPixmap(":/liveusb-header.png")) - self.label.setObjectName("label") + self.label.setGeometry(QtCore.QRect(0, 0, 430, 72)) + self.label.setText(_fromUtf8("")) + self.label.setPixmap(QtGui.QPixmap(_fromUtf8(":/liveusb-header.png"))) + self.label.setObjectName(_fromUtf8("label"))
self.retranslateUi(Dialog) QtCore.QMetaObject.connectSlotsByName(Dialog)
def retranslateUi(self, Dialog): - Dialog.setWindowTitle(QtGui.QApplication.translate("Dialog", _("Fedora LiveUSB Creator"), None, QtGui.QApplication.UnicodeUTF8)) - self.startButton.setWhatsThis(QtGui.QApplication.translate("Dialog", _("This button will begin the LiveUSB creation process. This entails optionally downloading a release (if an existing one wasn't selected), extracting the ISO to the USB device, creating the persistent overlay, and installing the bootloader."), None, QtGui.QApplication.UnicodeUTF8)) - self.startButton.setText(QtGui.QApplication.translate("Dialog", _("Create Live USB"), None, QtGui.QApplication.UnicodeUTF8)) - self.textEdit.setWhatsThis(QtGui.QApplication.translate("Dialog", _("This is the status console, where all messages get written to."), None, QtGui.QApplication.UnicodeUTF8)) - self.progressBar.setWhatsThis(QtGui.QApplication.translate("Dialog", _("This is the progress bar that will indicate how far along in the LiveUSB creation process you are"), None, QtGui.QApplication.UnicodeUTF8)) - self.downloadGroup.setWhatsThis(QtGui.QApplication.translate("Dialog", _("If you do not select an existing Live CD, the selected release will be downloaded for you."), None, QtGui.QApplication.UnicodeUTF8)) - self.downloadGroup.setTitle(QtGui.QApplication.translate("Dialog", _("Download Fedora"), None, QtGui.QApplication.UnicodeUTF8)) - self.label_2.setText(QtGui.QApplication.translate("Dialog", _("or"), None, QtGui.QApplication.UnicodeUTF8)) - self.groupBox.setWhatsThis(QtGui.QApplication.translate("Dialog", _("This button allows you to browse for an existing Live CD ISO that you have previously downloaded. If you do not select one, a release will be downloaded for you automatically."), None, QtGui.QApplication.UnicodeUTF8)) - self.groupBox.setTitle(QtGui.QApplication.translate("Dialog", _("Use existing Live CD"), None, QtGui.QApplication.UnicodeUTF8)) - self.isoBttn.setText(QtGui.QApplication.translate("Dialog", _("Browse"), None, QtGui.QApplication.UnicodeUTF8)) - self.isoBttn.setShortcut(QtGui.QApplication.translate("Dialog", "Alt+B", None, QtGui.QApplication.UnicodeUTF8)) - self.groupBox_2.setWhatsThis(QtGui.QApplication.translate("Dialog", _("This is the USB stick that you want to install your Live CD on. This device must be formatted with the FAT filesystem."), None, QtGui.QApplication.UnicodeUTF8)) - self.groupBox_2.setTitle(QtGui.QApplication.translate("Dialog", _("Target Device"), None, QtGui.QApplication.UnicodeUTF8)) - self.overlayTitle.setWhatsThis(QtGui.QApplication.translate("Dialog", _("By allocating extra space on your USB stick for a persistent overlay, you will be able to store data and make permanent modifications to your live operating system. Without it, you will not be able to save data that will persist after a reboot."), None, QtGui.QApplication.UnicodeUTF8)) - self.overlayTitle.setTitle(QtGui.QApplication.translate("Dialog", _("Persistent Storage") + " (0 MB)", None, QtGui.QApplication.UnicodeUTF8)) + Dialog.setWindowTitle(_translate("Dialog", "Fedora LiveUSB Creator", None)) + self.startButton.setWhatsThis(_translate("Dialog", "This button will begin the LiveUSB creation process. This entails optionally downloading a release (if an existing one wasn't selected), extracting the ISO to the USB device, creating the persistent overlay, and installing the bootloader.", None)) + self.startButton.setText(_translate("Dialog", "Create Live USB", None)) + self.textEdit.setWhatsThis(_translate("Dialog", "This is the status console, where all messages get written to.", None)) + self.progressBar.setWhatsThis(_translate("Dialog", "This is the progress bar that will indicate how far along in the LiveUSB creation process you are", None)) + self.downloadGroup.setWhatsThis(_translate("Dialog", "If you do not select an existing Live CD, the selected release will be downloaded for you.", None)) + self.downloadGroup.setTitle(_translate("Dialog", "Download Fedora", None)) + self.label_2.setText(_translate("Dialog", "or", None)) + self.groupBox.setWhatsThis(_translate("Dialog", "This button allows you to browse for an existing Live CD ISO that you have previously downloaded. If you do not select one, a release will be downloaded for you automatically.", None)) + self.groupBox.setTitle(_translate("Dialog", "Use existing Live CD", None)) + self.isoBttn.setText(_translate("Dialog", "Browse", None)) + self.isoBttn.setShortcut(_translate("Dialog", "Alt+B", None)) + self.groupBox_2.setWhatsThis(_translate("Dialog", "This is the USB stick that you want to install your Live CD on. This device must be formatted with the FAT filesystem.", None)) + self.groupBox_2.setTitle(_translate("Dialog", "Target Device", None)) + self.overlayTitle.setWhatsThis(_translate("Dialog", "By allocating extra space on your USB stick for a persistent overlay, you will be able to store data and make permanent modifications to your live operating system. Without it, you will not be able to save data that will persist after a reboot.", "comment!")) + self.overlayTitle.setTitle(_translate("Dialog", "Persistent Storage (0 MB)", None))
import resources_rc diff --git a/liveusb/releases.py b/liveusb/releases.py index 6611090..080ff21 100644 --- a/liveusb/releases.py +++ b/liveusb/releases.py @@ -1,29 +1,39 @@ -releases = ( - {'name': 'Fedora 17 i686 Desktop', - 'sha256': '26027f4d4686f1df186b31ce773dbb903db18f4b1aa37a1e37f0fa6ff4111f42', - 'url': 'http://dl.fedoraproject.org/pub/fedora/linux/releases/17/Live/i686/Fedora-17..., - {'name': 'Fedora 17 i686 KDE', - 'sha256': 'f10142bb0a4d91a0d8320a925fa33ab3a87d9764b03137bb30506830c1068583', - 'url': 'http://dl.fedoraproject.org/pub/fedora/linux/releases/17/Live/i686/Fedora-17..., - {'name': 'Fedora 17 x86_64 Desktop', - 'sha256': 'dfd19d677790fea6144bcf537cd031dfb0a50e6c56652c94bfc71ea7bb949f2c', - 'url': 'http://dl.fedoraproject.org/pub/fedora/linux/releases/17/Live/x86_64/Fedora-..., - {'name': 'Fedora 17 x86_64 KDE', - 'sha256': '58b9abf5ef6a07b75b6a934468c783ab18e5a1236e6e5ab75dc2b39ca7680462', - 'url': 'http://dl.fedoraproject.org/pub/fedora/linux/releases/17/Live/x86_64/Fedora-..., - {'name': 'Fedora 16 i686 Desktop', - 'sha256': '561d2c15fa79c319959cfc821650c829860651d1e5b125b2a425ac9cbd3fe1bb', - 'url': 'http://dl.fedoraproject.org/pub/fedora/linux/releases/16/Live/i686/Fedora-16..., - {'name': 'Fedora 16 i686 KDE', - 'sha256': '822567e4b05f7be6b89c14e6165f4c9e0f388379c3f90e0bf439dd8397e87a3f', - 'url': 'http://dl.fedoraproject.org/pub/fedora/linux/releases/16/Live/i686/Fedora-16..., - {'name': 'Fedora 16 x86_64 Desktop', - 'sha256': '632b2de39033ed1d4a61959c4002e07248793eff828ac5d60edbb7b5dcd7be5c', - 'url': 'http://dl.fedoraproject.org/pub/fedora/linux/releases/16/Live/x86_64/Fedora-..., - {'name': 'Fedora 16 x86_64 KDE', - 'sha256': 'b10ff86610e46244b11f0a411915e80ca4fdf1e8ec20ee5b61f700feb0716ba8', - 'url': 'http://dl.fedoraproject.org/pub/fedora/linux/releases/16/Live/x86_64/Fedora-..., +import re +from urlgrabber import urlread +from urlgrabber.grabber import URLGrabError
+FEDORA_RELEASES = 'http://dl.fedoraproject.org/pub/fedora/linux/releases/' +ARCHES = ('i386', 'i686', 'x86_64') + +# A backup list of releases, just in case we can't fetch them. +fedora_releases = [ + {'name': 'Fedora 17 i686 Desktop', + 'sha256': '26027f4d4686f1df186b31ce773dbb903db18f4b1aa37a1e37f0fa6ff4111f42', + 'url': 'http://dl.fedoraproject.org/pub/fedora/linux/releases/17/Live/i686/Fedora-17..., + {'name': 'Fedora 17 i686 KDE', + 'sha256': 'f10142bb0a4d91a0d8320a925fa33ab3a87d9764b03137bb30506830c1068583', + 'url': 'http://dl.fedoraproject.org/pub/fedora/linux/releases/17/Live/i686/Fedora-17..., + {'name': 'Fedora 17 x86_64 Desktop', + 'sha256': 'dfd19d677790fea6144bcf537cd031dfb0a50e6c56652c94bfc71ea7bb949f2c', + 'url': 'http://dl.fedoraproject.org/pub/fedora/linux/releases/17/Live/x86_64/Fedora-..., + {'name': 'Fedora 17 x86_64 KDE', + 'sha256': '58b9abf5ef6a07b75b6a934468c783ab18e5a1236e6e5ab75dc2b39ca7680462', + 'url': 'http://dl.fedoraproject.org/pub/fedora/linux/releases/17/Live/x86_64/Fedora-..., + {'name': 'Fedora 16 i686 Desktop', + 'sha256': '561d2c15fa79c319959cfc821650c829860651d1e5b125b2a425ac9cbd3fe1bb', + 'url': 'http://dl.fedoraproject.org/pub/fedora/linux/releases/16/Live/i686/Fedora-16..., + {'name': 'Fedora 16 i686 KDE', + 'sha256': '822567e4b05f7be6b89c14e6165f4c9e0f388379c3f90e0bf439dd8397e87a3f', + 'url': 'http://dl.fedoraproject.org/pub/fedora/linux/releases/16/Live/i686/Fedora-16..., + {'name': 'Fedora 16 x86_64 Desktop', + 'sha256': '632b2de39033ed1d4a61959c4002e07248793eff828ac5d60edbb7b5dcd7be5c', + 'url': 'http://dl.fedoraproject.org/pub/fedora/linux/releases/16/Live/x86_64/Fedora-..., + {'name': 'Fedora 16 x86_64 KDE', + 'sha256': 'b10ff86610e46244b11f0a411915e80ca4fdf1e8ec20ee5b61f700feb0716ba8', + 'url': 'http://dl.fedoraproject.org/pub/fedora/linux/releases/16/Live/x86_64/Fedora-..., +] + +other_releases = [ ## ## Custom spins ## @@ -32,4 +42,44 @@ releases = ( 'url': 'https://alt.fedoraproject.org/pub/alt/spins/linux/releases/16/Spins/i686/Fed...', 'sha256': '5aa938737cc4ebeb1d269c4d8b2bf56e41bacd1967c3997b8969b42b88b63bfa', }, -) +] + +releases = fedora_releases + other_releases + + +def get_fedora_releases(): + global releases + fedora_releases = [] + try: + html = urlread(FEDORA_RELEASES) + for release in re.findall(r'<a href="(\d+)/">', html)[-2:][::-1]: + for arch in ARCHES: + arch_url = FEDORA_RELEASES + '%s/Live/%s/' % (release, arch) + try: + files = urlread(arch_url) + except URLGrabError: + continue + for link in re.findall(r'<a href="(.*)">', files): + if link.endswith('-CHECKSUM'): + checksum = urlread(arch_url + link) + for line in checksum.split('\n'): + try: + sha256, filename = line.split() + if filename[0] != '*': + continue + filename = filename[1:] + chunks = filename[:-4].split('-') + chunks.remove('Live') + name = ' '.join(chunks) + fedora_releases.append(dict( + name=name, + url=arch_url + filename, + sha256=sha256, + )) + except ValueError: + pass + releases = fedora_releases + other_releases + except: + # Can't fetch releases from the internet. + releases += other_releases + return releases
commit 008dc0ee86fbac6fc90e4f32d2baa59ef68c13ec Author: Luke Macken <lmacken@redhat.com> Date: Tue Jan 15 09:28:48 2013 -0500
F18 live images are under i386 now
diff --git a/get_releases.py b/get_releases.py index 6fb5054..c8e067d 100644 --- a/get_releases.py +++ b/get_releases.py @@ -1,8 +1,9 @@ import re from urlgrabber import urlread +from urlgrabber.grabber import URLGrabError
FEDORA_RELEASES = 'http://dl.fedoraproject.org/pub/fedora/linux/releases/' -ARCHES = ('i686', 'x86_64') +ARCHES = ('i386', 'i686', 'x86_64')
def get_fedora_releases(): releases = [] @@ -10,7 +11,10 @@ def get_fedora_releases(): for release in re.findall(r'<a href="(\d+)/">', html)[-2:][::-1]: for arch in ARCHES: arch_url = FEDORA_RELEASES + '%s/Live/%s/' % (release, arch) - files = urlread(arch_url) + try: + files = urlread(arch_url) + except URLGrabError: + continue for link in re.findall(r'<a href="(.*)">', files): if link.endswith('-CHECKSUM'): checksum = urlread(arch_url + link)
commit 284d4b1efc07af51fed8f661b0cb20bfbecc013e Author: Luke Macken <lmacken@redhat.com> Date: Fri Jan 4 13:50:22 2013 -0500
Don't call sys.exit in our __init__ (rhbz#842878)
diff --git a/liveusb-creator b/liveusb-creator index 1dc4dea..e3f230c 100755 --- a/liveusb-creator +++ b/liveusb-creator @@ -18,6 +18,11 @@ # # Author(s): Luke Macken <lmacken@redhat.com>
+import os +import sys + +from liveusb import _ + __version__ = '3.11.7'
def parse_args(): @@ -78,7 +83,6 @@ def main(): x = raw_input("\nDone! Press any key to exit") else: ## Start our graphical interface - import sys from liveusb.gui import LiveUSBApp try: LiveUSBApp(opts, sys.argv) @@ -86,4 +90,8 @@ def main(): pass
if __name__ == '__main__': + if sys.platform != 'win32': + if os.getuid() != 0: + print >> sys.stderr, _("You must run this application as root") + sys.exit(1) main() diff --git a/liveusb/__init__.py b/liveusb/__init__.py index e3c0556..d0717dd 100644 --- a/liveusb/__init__.py +++ b/liveusb/__init__.py @@ -43,9 +43,6 @@ if sys.platform == "win32": from liveusb.creator import WindowsLiveUSBCreator as LiveUSBCreator from liveusb.windows_dialog import Ui_Dialog as LiveUSBInterface else: - if os.getuid() != 0: - print >> sys.stderr, _("You must run this application as root") - sys.exit(1) from liveusb.creator import LinuxLiveUSBCreator as LiveUSBCreator from liveusb.linux_dialog import Ui_Dialog as LiveUSBInterface
commit 3b252768cc8178a53caf597d5e8d2a57a60d5ae0 Author: Luke Macken <lmacken@redhat.com> Date: Mon Dec 17 19:52:18 2012 -0500
Modernize our installer style and translate it appropriately [ticket:808]
Thanks to ivanromanov for the patch!
diff --git a/data/liveusb-creator.nsi b/data/liveusb-creator.nsi index e5a13d0..03f3760 100644 --- a/data/liveusb-creator.nsi +++ b/data/liveusb-creator.nsi @@ -1,6 +1,9 @@ Name "LiveUSB Creator 3.11.7" OutFile "liveusb-creator-3.11.7-setup.exe"
+!include "MUI2.nsh" +XPStyle on + SetCompressor lzma
InstallDir "$PROGRAMFILES\LiveUSB Creator" @@ -8,7 +11,75 @@ InstallDirRegKey HKEY_LOCAL_MACHINE "SOFTWARE\LiveUSB Creator" ""
DirText "Select the directory to install LiveUSB Creator in:"
-Icon liveusb-creator.ico +!define MUI_ICON liveusb-creator.ico +;!define MUI_UNICON liveusb-creator.ico + +!insertmacro MUI_PAGE_WELCOME +!insertmacro MUI_PAGE_DIRECTORY +!insertmacro MUI_PAGE_INSTFILES +!define MUI_FINISHPAGE_NOAUTOCLOSE +!define MUI_FINISHPAGE_RUN $INSTDIR\liveusb-creator.exe +!insertmacro MUI_PAGE_FINISH + +!insertmacro MUI_UNPAGE_CONFIRM +!insertmacro MUI_UNPAGE_INSTFILES + +!insertmacro MUI_LANGUAGE "English" ;first language is the default language +!insertmacro MUI_LANGUAGE "French" +!insertmacro MUI_LANGUAGE "German" +!insertmacro MUI_LANGUAGE "Spanish" +!insertmacro MUI_LANGUAGE "SpanishInternational" +!insertmacro MUI_LANGUAGE "SimpChinese" +!insertmacro MUI_LANGUAGE "TradChinese" +!insertmacro MUI_LANGUAGE "Japanese" +!insertmacro MUI_LANGUAGE "Korean" +!insertmacro MUI_LANGUAGE "Italian" +!insertmacro MUI_LANGUAGE "Dutch" +!insertmacro MUI_LANGUAGE "Danish" +!insertmacro MUI_LANGUAGE "Swedish" +!insertmacro MUI_LANGUAGE "Norwegian" +!insertmacro MUI_LANGUAGE "NorwegianNynorsk" +!insertmacro MUI_LANGUAGE "Finnish" +!insertmacro MUI_LANGUAGE "Greek" +!insertmacro MUI_LANGUAGE "Russian" +!insertmacro MUI_LANGUAGE "Portuguese" +!insertmacro MUI_LANGUAGE "PortugueseBR" +!insertmacro MUI_LANGUAGE "Polish" +!insertmacro MUI_LANGUAGE "Ukrainian" +!insertmacro MUI_LANGUAGE "Czech" +!insertmacro MUI_LANGUAGE "Slovak" +!insertmacro MUI_LANGUAGE "Croatian" +!insertmacro MUI_LANGUAGE "Bulgarian" +!insertmacro MUI_LANGUAGE "Hungarian" +!insertmacro MUI_LANGUAGE "Thai" +!insertmacro MUI_LANGUAGE "Romanian" +!insertmacro MUI_LANGUAGE "Latvian" +!insertmacro MUI_LANGUAGE "Macedonian" +!insertmacro MUI_LANGUAGE "Estonian" +!insertmacro MUI_LANGUAGE "Turkish" +!insertmacro MUI_LANGUAGE "Lithuanian" +!insertmacro MUI_LANGUAGE "Slovenian" +!insertmacro MUI_LANGUAGE "Serbian" +!insertmacro MUI_LANGUAGE "SerbianLatin" +!insertmacro MUI_LANGUAGE "Arabic" +!insertmacro MUI_LANGUAGE "Farsi" +!insertmacro MUI_LANGUAGE "Hebrew" +!insertmacro MUI_LANGUAGE "Indonesian" +!insertmacro MUI_LANGUAGE "Mongolian" +!insertmacro MUI_LANGUAGE "Luxembourgish" +!insertmacro MUI_LANGUAGE "Albanian" +!insertmacro MUI_LANGUAGE "Breton" +!insertmacro MUI_LANGUAGE "Belarusian" +!insertmacro MUI_LANGUAGE "Icelandic" +!insertmacro MUI_LANGUAGE "Malay" +!insertmacro MUI_LANGUAGE "Bosnian" +!insertmacro MUI_LANGUAGE "Kurdish" +!insertmacro MUI_LANGUAGE "Irish" +!insertmacro MUI_LANGUAGE "Uzbek" +!insertmacro MUI_LANGUAGE "Galician" +!insertmacro MUI_LANGUAGE "Afrikaans" +!insertmacro MUI_LANGUAGE "Catalan" +!insertmacro MUI_LANGUAGE "Esperanto"
Section ""
@@ -44,11 +115,6 @@ Section "" CreateShortCut "$SMPROGRAMS\LiveUSB Creator\LiveUSB Creator.lnk" "$INSTDIR\liveusb-creator.exe" CreateShortCut "$SMPROGRAMS\LiveUSB Creator\Uninstall LiveUSB Creator.lnk" "$INSTDIR\uninst.exe" "" "$INSTDIR\uninst.exe" 0
- ; Optionally start program. - MessageBox MB_YESNO|MB_ICONQUESTION "Run LiveUSB Creator now?" IDNO SkipRunProgram - Exec "$INSTDIR\liveusb-creator.exe" -SkipRunProgram: - ; Create uninstaller. WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\LiveUSB Creator" "" "$INSTDIR" WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\LiveUSB Creator" "DisplayName" "LiveUSB Creator (remove only)" @@ -92,3 +158,24 @@ Section Uninstall RMDir "$INSTDIR"
SectionEnd + +!macro SetUILanguage UN +Function ${UN}SetUILanguage + Push $R0 + ; Call GetUserDefaultUILanguage (available on Windows Me, 2000 and later) + ; $R0 = GetUserDefaultUILanguage() + System::Call 'kernel32::GetUserDefaultUILanguage() i.r10' + StrCpy $LANGUAGE $R0 + Pop $R0 +FunctionEnd +!macroend +!insertmacro SetUILanguage "" +!insertmacro SetUILanguage "un." + +Function .onInit + Call SetUILanguage +FunctionEnd + +Function un.onInit + Call un.SetUILanguage +FunctionEnd
commit 71909642f0bf135a5d2bc2add77f781d131eaa2c Author: Luke Macken <lmacken@redhat.com> Date: Mon Dec 17 19:48:42 2012 -0500
Get our translations working properly under Windows. [ticket:806]
Thanks to ivanromanov for the patch!
diff --git a/data/liveusb-creator.nsi b/data/liveusb-creator.nsi index d6c3885..e5a13d0 100644 --- a/data/liveusb-creator.nsi +++ b/data/liveusb-creator.nsi @@ -29,6 +29,7 @@ Section "" File LICENSE.txt File README.txt File w9xpopen.exe + File /r locale SetOutPath $INSTDIR\tools File tools\7z.dll @@ -86,6 +87,7 @@ Section Uninstall Delete "$INSTDIR\liveusb-creator.exe.log"
; Remove the installation directories. + RMDir /R "$INSTDIR\locale" RMDir "$INSTDIR\tools" RMDir "$INSTDIR"
diff --git a/liveusb/__init__.py b/liveusb/__init__.py index eff0518..e3c0556 100644 --- a/liveusb/__init__.py +++ b/liveusb/__init__.py @@ -22,13 +22,9 @@ import sys import gettext import locale
-# Cope with i18n on windows: this should not arm on other OS -# only solution to have it work on WinXP FR locale -locale.setlocale(locale.LC_ALL, '') -lang=locale.getlocale(locale.LC_ALL)[0] -os.environ['LANG'] = lang -#print >> sys.stderr, lang -#print >> sys.stderr, os.getenv('LANG') +if sys.platform == 'win32': + import gettext_windows + gettext_windows.setup_env()
if os.path.exists('locale'): translation = gettext.translation('liveusb-creator', 'locale', fallback=True) diff --git a/release.bat b/release.bat index a03e411..ba8648d 100644 --- a/release.bat +++ b/release.bat @@ -5,10 +5,20 @@ echo Generating an exe of the liveusb-creator %1 rmdir /S /Q dist rmdir /S /Q build rmdir /S /Q liveusb-creator-%1 + +cd po +rmdir /S /Q locale +for %%f in (*.po) do ( + mkdir locale%%~Nf\LC_MESSAGES + python C:\Python27\Tools\i18n\msgfmt.py -o locale%%~Nf\LC_MESSAGES\liveusb-creator.mo %%f +) +cd .. + python -OO setup.py py2exe + copy README.txt dist copy data\fedora.ico dist\liveusb-creator.ico -copy data\vcredist_x86.exe dist +copy data\vcredist_x86.exe dist\ copy data\liveusb-creator.nsi dist\liveusb-creator.nsi "C:\Program Files\NSIS\makensis.exe" dist\liveusb-creator.nsi rename dist liveusb-creator-%1
liveusb-creator@lists.stg.fedorahosted.org