Changeset 36048 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Feb 22, 2011 10:59:08 AM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 70158
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxShell/vboxshell.py
r36002 r36048 181 181 except KeyboardInterrupt: 182 182 print "Interrupted." 183 ctx['interrupt'] = True 183 184 if p.cancelable: 184 185 print "Canceling task..." … … 489 490 490 491 # We need to catch all exceptions here, to close file 492 except KeyboardInterrupt: 493 ctx['interrupt'] = True 491 494 except: 492 495 traceback.print_exc() … … 691 694 try: 692 695 ops[cmd]() 696 except KeyboardInterrupt: 697 ctx['interrupt'] = True 693 698 except Exception, e: 694 699 printErr(ctx,e) … … 1118 1123 except KeyboardInterrupt: 1119 1124 print "Interrupted." 1125 ctx['interrupt'] = True 1120 1126 if progress.cancelable: 1121 1127 progress.cancel() … … 1735 1741 return 0 1736 1742 1737 1738 1743 def runScriptCmd(ctx, args): 1739 1744 if (len(args) != 2): … … 1747 1752 1748 1753 try: 1749 for line in lf: 1754 lines = lf.readlines() 1755 ctx['scriptLine'] = 0 1756 ctx['interrupt'] = False 1757 while ctx['scriptLine'] < len(lines): 1758 line = lines[ctx['scriptLine']] 1759 ctx['scriptLine'] = ctx['scriptLine'] + 1 1750 1760 done = runCommand(ctx, line) 1751 if done != 0: break 1761 if done != 0 or ctx['interrupt']: 1762 break 1763 1752 1764 except Exception,e: 1753 1765 printErr(ctx,e) … … 3156 3168 3157 3169 cmdClosedVm(ctx, mach, lambda ctx,mach,a: mach.detachHostPciDevice(hostaddr)) 3170 return 0 3171 3172 def gotoCmd(ctx, args): 3173 if (len(args) < 2): 3174 print "usage: goto line" 3175 return 0 3176 3177 line = int(args[1]) 3178 3179 ctx['scriptLine'] = line 3180 3158 3181 return 0 3159 3182 … … 3246 3269 'lspci': ['List PCI devices attached to the VM: lspci Win32', lspciCmd, 0], 3247 3270 'attachpci': ['Attach host PCI device to the VM: attachpci Win32 01:00.0', attachpciCmd, 0], 3248 'detachpci': ['Detach host PCI device from the VM: detachpci Win32 01:00.0', detachpciCmd, 0] 3271 'detachpci': ['Detach host PCI device from the VM: detachpci Win32 01:00.0', detachpciCmd, 0], 3272 'goto': ['Go to line in script (script-only)', gotoCmd, 0] 3249 3273 } 3250 3274 … … 3473 3497 'typeInGuest': typeInGuest, 3474 3498 '_machlist': None, 3475 'prompt': g_prompt 3499 'prompt': g_prompt, 3500 'scriptLine': 0, 3501 'interrupt': False 3476 3502 } 3477 3503 interpret(ctx)
Note:
See TracChangeset
for help on using the changeset viewer.