Add debug info and qemu enhancement

1. Added debug info to check the python version
2. Added kvm option in qemu under Linux
pull/276/head
mbusb 6 years ago
parent 3136ffe4fa
commit 75342f1198

@ -19,6 +19,13 @@ sys.path.append('/usr/local/lib/python3.5/dist-packages') # for version 8.9.0 o
if '/usr/lib/python3/dist-packages/scripts/' not in sys.path:
sys.path.append('/usr/lib/python3/dist-packages/scripts/')
# May users install multibootusb on python 2.7 and report as multibootusb issue
# We need to know which version are they using so the below lines are required.
# We need to do this here otherwise it failes on import error
python_version = sys.version
_platform = platform.platform()
print('Using python version ', python_version, 'on platform', _platform)
# Had trouble in importing scripts directory. Had to add few lines below to ensure it works on source as well as
# post install
try:
@ -43,6 +50,7 @@ def running_from():
"""
Print version and path location (installed or source code) info for debugging later.
"""
gen.log('Using python version ' + python_version + 'on platform ' + _platform, _print=False)
if os.path.exists('scripts'):
gen.log('Running multibootusb version ' + gen.mbusb_version() + ' from source...')
else:

@ -22,7 +22,7 @@ def scripts_dir_path():
return os.path.dirname(os.path.realpath(__file__))
def log(message, info=True, error=False, debug=False):
def log(message, info=True, error=False, debug=False, _print=True):
"""
Dirty function to log messages to file and also print on screen.
:param message:
@ -43,7 +43,8 @@ def log(message, info=True, error=False, debug=False):
format='%(asctime)s.%(msecs)03d %(name)s %(levelname)s %(message)s',
datefmt='%H:%M:%S',
level=logging.DEBUG)
print(message)
if _print is True:
print(message)
# remove ANSI color codes from logs
# message_clean = re.compile(r'\x1b[^m]*m').sub('', message)

@ -48,7 +48,7 @@ class Qemu(QtWidgets.QMainWindow, Ui_MainWindow):
else:
ram = ""
cmd = qemu + ram + ' -boot d' + ' -cdrom "' + str(qemu_iso_link) + '"'
cmd = qemu + ram + ' -enable-kvm -boot d' + ' -cdrom "' + str(qemu_iso_link) + '"'
try:
log("Executing ==> " + cmd)
subprocess.Popen(cmd, shell=True)
@ -98,7 +98,7 @@ class Qemu(QtWidgets.QMainWindow, Ui_MainWindow):
os.chdir(parent_dir)
elif platform.system() == "Linux":
cmd = qemu + ' -hda "' + qemu_usb_disk + '"' + ram + ' -vga std'
cmd = qemu + ' -enable-kvm -hda "' + qemu_usb_disk + '"' + ram + ' -vga std'
try:
log('Executing ==> ' + cmd)
subprocess.Popen(cmd, shell=True)

Loading…
Cancel
Save