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
pull/128/head
mbusb 7 years ago
parent 0e73b8b301
commit 7c98ec00a0

3
.gitignore vendored

@ -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

@ -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"""))

@ -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()

@ -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):

Loading…
Cancel
Save