Fixed for command line interface and minor improvements

1.  Fixed bug which prevents installing distro through CLI
2.  Added entries for windoes cli and uninstall in usage for CLI
3.  Added "Alin Trăistaru (alindt)" in authors list and reduced About window size
4.  Fixed few other minor bugs
pull/149/head
mbusb 7 years ago
parent 7878912172
commit 160e1a75d2

@ -1,4 +1,4 @@
####User guide is located here http://multibootusb.org/page_guide/
#### User guide is located here http://multibootusb.org/page_guide/
What is multibootusb?
---------------------

@ -45,7 +45,11 @@ def usage():
print(' -u or --uninstall : List and uninstall distro from USB disk')
print(' -d or --debug : Enable debug messages (very verbose!)\n')
print(' Command line example for making a bootable USB from command line should look like this:\n')
print('\tpython3 multibootusb -c -i ../../favourite.iso -t /dev/sdb1\n')
print('\tpython3 multibootusb -c -i ../../favourite.iso -t /dev/sdb1 on Linux and \n')
print('\tpython3 multibootusb -c -i ../../favourite.iso -t /dev/sdb1 on Windows\n')
print(' Command line example for uninstalling distro from USB should look like this:\n')
print('\tpython3 multibootusb -c -u -t /dev/sdb1 on Linux and \n')
print('\tpython3 multibootusb -c -u -t /dev/sdb1 on Windows\n')
exit(2)
@ -79,7 +83,7 @@ if __name__ == '__main__':
print_version()
sys.exit()
elif opt in ('-i', '--iso'):
config.iso_link = arg
config.image_path = arg
elif opt in ('-t', '--target'):
config.usb_disk = arg
elif opt in ('-c', '--command'):

@ -111,7 +111,7 @@ def test_iso(iso_link, suppress_out=True):
_cmd = _7zip + ' t ' + iso_link + suppress_out
# gen.log('Executing', _cmd)
gen.log('Executing ==> ' + _cmd)
rc = subprocess.call(_cmd, shell=True)

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>640</width>
<height>380</height>
<width>498</width>
<height>369</height>
</rect>
</property>
<property name="sizePolicy">
@ -25,7 +25,7 @@
<item row="1" column="1">
<widget class="QLabel" name="label_6">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;An advanced bootable usb creator with option to install/uninstall multiple distros.&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;This software is written in Python and PyQt. &lt;/p&gt;&lt;p align=&quot;center&quot;&gt;Copyright 2010-2017 Sundar&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Author(s)&lt;/span&gt;: Sundar, Ian Bruce, Lee&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Licence&lt;/span&gt;: GPL version 2 or later&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Home page&lt;/span&gt;: &lt;a href=&quot; http://multibootusb.org&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;http://multibootusb.org&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Help/Email&lt;/span&gt;: feedback.multibootusb@gmail.com&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Source Code&lt;/span&gt;: &lt;a href=&quot;https://github.com/mbusb/multibootusb&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;https://github.com/mbusb/multibootusb&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;An advanced bootable usb creator with option to install/uninstall multiple distros.&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;This software is written in Python and PyQt. &lt;/p&gt;&lt;p align=&quot;center&quot;&gt;Copyright 2010-2017 Sundar&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Author(s)&lt;/span&gt;: Sundar, Ian Bruce, LiQiong Lee and Alin Trăistaru (alindt)&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Licence&lt;/span&gt;: GPL version 2 or later&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Home page&lt;/span&gt;: &lt;a href=&quot; http://multibootusb.org&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;http://multibootusb.org&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Help/Email&lt;/span&gt;: feedback.multibootusb@gmail.com&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Source Code&lt;/span&gt;: &lt;a href=&quot;https://github.com/mbusb/multibootusb&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;https://github.com/mbusb/multibootusb&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>

@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'gui/about.ui'
# Form implementation generated from reading ui file 'about.ui'
#
# Created by: PyQt5 UI code generator 5.5.1
# Created by: PyQt5 UI code generator 5.6
#
# WARNING! All changes made in this file will be lost!
@ -11,7 +11,7 @@ from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_About(object):
def setupUi(self, About):
About.setObjectName("About")
About.resize(640, 380)
About.resize(498, 369)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
@ -48,6 +48,16 @@ class Ui_About(object):
def retranslateUi(self, About):
_translate = QtCore.QCoreApplication.translate
About.setWindowTitle(_translate("About", "Dialog"))
self.label_6.setText(_translate("About", "<html><head/><body><p align=\"center\">An advanced bootable usb creator with option to install/uninstall multiple distros.</p><p align=\"center\">This software is written in Python and PyQt. </p><p align=\"center\">Copyright 2010-2017 Sundar</p><p align=\"center\"><span style=\" font-weight:600;\">Author(s)</span>: Sundar, Ian Bruce, Lee</p><p align=\"center\"><span style=\" font-weight:600;\">Licence</span>: GPL version 2 or later</p><p align=\"center\"><span style=\" font-weight:600;\">Home page</span>: <a href=\" http://multibootusb.org\"><span style=\" text-decoration: underline; color:#0000ff;\">http://multibootusb.org</span></a></p><p align=\"center\"><span style=\" font-weight:600;\">Help/Email</span>: feedback.multibootusb@gmail.com</p><p align=\"center\"><span style=\" font-weight:600;\">Source Code</span>: <a href=\"https://github.com/mbusb/multibootusb\"><span style=\" text-decoration: underline; color:#0000ff;\">https://github.com/mbusb/multibootusb</span></a></p><p><br/></p></body></html>"))
self.label_6.setText(_translate("About", "<html><head/><body><p align=\"center\">An advanced bootable usb creator with option to install/uninstall multiple distros.</p><p align=\"center\">This software is written in Python and PyQt. </p><p align=\"center\">Copyright 2010-2017 Sundar</p><p align=\"center\"><span style=\" font-weight:600;\">Author(s)</span>: Sundar, Ian Bruce, LiQiong Lee and Alin Trăistaru (alindt)</p><p align=\"center\"><span style=\" font-weight:600;\">Licence</span>: GPL version 2 or later</p><p align=\"center\"><span style=\" font-weight:600;\">Home page</span>: <a href=\" http://multibootusb.org\"><span style=\" text-decoration: underline; color:#0000ff;\">http://multibootusb.org</span></a></p><p align=\"center\"><span style=\" font-weight:600;\">Help/Email</span>: feedback.multibootusb@gmail.com</p><p align=\"center\"><span style=\" font-weight:600;\">Source Code</span>: <a href=\"https://github.com/mbusb/multibootusb\"><span style=\" text-decoration: underline; color:#0000ff;\">https://github.com/mbusb/multibootusb</span></a></p><p><br/></p></body></html>"))
self.button_close.setText(_translate("About", "Close"))
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
About = QtWidgets.QDialog()
ui = Ui_About()
ui.setupUi(About)
About.show()
sys.exit(app.exec_())

@ -28,7 +28,8 @@ def install_distro():
:return:
"""
usb_mount = config.usb_mount
install_dir = os.path.join(usb_mount, "multibootusb", iso_basename(config.image_path))
print('------------------>' + config.usb_mount)
install_dir = os.path.join(config.usb_mount, "multibootusb", iso_basename(config.image_path))
_iso_file_list = iso.iso_file_list(config.image_path)
if not os.path.exists(os.path.join(usb_mount, "multibootusb")):
@ -122,6 +123,7 @@ def copy_iso(src, dst):
elif platform.system() == "Linux":
shutil.copy(src, dst)
def install_progress():
"""
Function to calculate progress percentage of install.
@ -130,7 +132,7 @@ def install_progress():
from . import progressbar
usb_details = details(config.usb_disk)
usb_mount = usb_details['mount_point']
config.usb_mount = usb_details['mount_point']
usb_size_used = usb_details['size_used']
thrd = threading.Thread(target=install_distro, name="install_progress")
# thrd.daemon()

@ -43,19 +43,19 @@ def cli_install_distro():
if usb.is_block(config.usb_disk) is False:
log(config.usb_disk, 'is not a valid device partition...')
exit(1)
elif integrity(config.image_path) is not True:
log(config.image_path, ' failed to pass integrity check...')
exit(1)
#elif integrity(config.image_path) is not True:
# log(config.image_path, ' failed to pass integrity check...')
# exit(1)
elif size_not_enough(config.image_path, config.usb_disk) is True:
log(config.usb_disk, 'does not have enough space...')
log(config.usb_disk + 'does not have enough space...')
else:
prepare_mbusb_host_dir()
extract_cfg_file(config.image_path)
_distro = distro(iso_cfg_ext_dir(), config.image_path)
log('Detected distro type is', _distro)
if _distro is not None:
log('\nSelected ISO is :', quote(iso_name(config.image_path)))
log('Selected target device is:', quote(config.usb_disk), '\n')
log('Detected distro type is :' + _distro)
log('\nSelected ISO is :'+ quote(iso_name(config.image_path)))
log('Selected target device is :'+ quote(config.usb_disk), '\n')
log('Please confirm the option.')
log('Y/y/Yes/yes/YES or N/n/No/no/NO')
if read_input_yes() is True:
@ -66,15 +66,15 @@ def cli_install_distro():
syslinux_default(config.usb_disk)
update_distro_cfg_files(config.image_path, config.usb_disk, _distro)
else:
log('Sorry', iso_name(config.image_path), 'is not supported at the moment\n'
'Please report tissue at https://github.com/mbusb/multibootusb/issues')
log('\n\nSorry ' + iso_name(config.image_path) + ' is not supported at the moment.\n'
'Please report tissue at https://github.com/mbusb/multibootusb/issues\n')
def cli_uninstall_distro():
distro_list = install_distro_list()
if distro_list is not None:
for index, _distro_dir in enumerate(distro_list):
log(index, '--->>', _distro_dir)
log(str(index) + ' --->> ' + _distro_dir)
user_input = read_input_uninstall()
if user_input is not False:
for index, _distro_dir in enumerate(distro_list):

Loading…
Cancel
Save