2
0
mirror of https://github.com/mbusb/multibootusb synced 2024-11-01 15:40:16 +00:00

Windows Fix for commit 0e73b8b

1. Activate listing of devices when All drives option is enabled and disabled
2. Add a dummy devtype to usb.py module to avoid crash under Windows
This commit is contained in:
mbusb 2017-04-17 22:31:51 +05:30
parent 0e73b8b301
commit 7c98ec00a0
5 changed files with 16 additions and 6 deletions

3
.gitignore vendored
View File

@ -103,4 +103,5 @@ multibootusb*.exe
*.swp
# Test file which I work on to test logic before committing to main file.
mbusb_te*py
mbusb_te*py
text.txt

0
multibootusb Executable file → Normal file
View File

View File

@ -384,9 +384,14 @@ def process_exist(process_name):
def write_to_file(filepath, text):
if not os.path.exists(filepath):
with open(filepath, 'w') as f:
f.write(text.strip())
"""
Simple function to write a text file
:param filepath: Path to file
:param text: Text to be written on to file
:return:
"""
with open(filepath, 'w') as f:
f.write(text.strip())
if __name__ == '__main__':
log(quote("""Test-string"""))

View File

@ -103,7 +103,8 @@ class AppGui(qemu.Qemu, Imager, QtWidgets.QMainWindow, Ui_MainWindow):
Include fixed drives to available USB devices.
:return:
"""
if self.ui.checkbox_all_drives.isChecked() is False:
if self.ui.checkbox_all_drives.isChecked() is False:
self.onRefreshClick()
return
reply = QtWidgets.QMessageBox.warning(self, "WARNING!",
@ -116,6 +117,8 @@ Are you SURE you want to enable it?",
self.ui.checkbox_all_drives.setChecked(False)
elif reply == QtWidgets.QMessageBox.Yes:
self.ui.checkbox_all_drives.setChecked(True)
self.onRefreshClick()
def onAboutClick(self):
about = QtWidgets.QDialog()

View File

@ -330,6 +330,7 @@ def win_disk_details(disk_drive):
pythoncom.CoInitialize()
vendor = 'Not_Found'
model = 'Not_Found'
devtype = 'Patition'
selected_usb_part = str(disk_drive)
oFS = win32com.client.Dispatch("Scripting.FileSystemObject")
d = oFS.GetDrive(oFS.GetDriveName(oFS.GetAbsolutePathName(selected_usb_part)))
@ -359,7 +360,7 @@ def win_disk_details(disk_drive):
return {'uuid': uuid, 'file_system': file_system, 'label': label, 'mount_point': mount_point,
'size_total': size_total, 'size_used': size_used, 'size_free': size_free,
'vendor': vendor, 'model': model}
'vendor': vendor, 'model': model, 'devtype': devtype}
def details(usb_disk_part):