Changeset 30345 in vbox for trunk/src/VBox/Frontends/VBoxShell
- Timestamp:
- Jun 21, 2010 4:49:59 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxShell/vboxshell.py
r30280 r30345 426 426 pass 427 427 vbox.unregisterCallback(cb) 428 429 def monitorVBox2(ctx, dur): 430 vbox = ctx['vb'] 431 print vbox.eventSource 432 listener = vbox.eventSource.createListener() 433 if dur == -1: 434 # not infinity, but close enough 435 dur = 100000 436 try: 437 vbox.eventSource.registerListener(listener, [ctx['global'].constants.VBoxEventType_All], False) 438 end = time.time() + dur 439 while time.time() < end: 440 ev = vbox.eventSource.getEvent(500) 441 if ev: 442 print "got event: %s %s" %(ev, str(ev.type)) 443 # We need to catch all exceptions here, otherwise callback will never be unregistered 444 except: 445 traceback.print_exc() 446 pass 447 vbox.eventSource.unregisterListener(listener) 428 448 429 449 … … 1387 1407 dur = float(args[1]) 1388 1408 monitorVBox(ctx, dur) 1409 return 0 1410 1411 def monitorVBox2Cmd(ctx, args): 1412 if (len(args) > 2): 1413 print "usage: monitorVBox2 (duration)" 1414 return 0 1415 dur = 5 1416 if len(args) > 1: 1417 dur = float(args[1]) 1418 monitorVBox2(ctx, dur) 1389 1419 return 0 1390 1420 … … 2856 2886 'monitorGuest':['Monitor what happens with the guest for some time: monitorGuest Win32 10', monitorGuestCmd, 0], 2857 2887 'monitorVBox':['Monitor what happens with Virtual Box for some time: monitorVBox 10', monitorVBoxCmd, 0], 2888 'monitorVBox2':['(temp)Monitor what happens with Virtual Box for some time: monitorVBox2 10', monitorVBox2Cmd, 0], 2858 2889 'portForward':['Setup permanent port forwarding for a VM, takes adapter number host port and guest port: portForward Win32 0 8080 80', portForwardCmd, 0], 2859 2890 'showLog':['Show log file of the VM, : showLog Win32', showLogCmd, 0],
Note:
See TracChangeset
for help on using the changeset viewer.