Changeset 19239 in vbox for trunk/src/VBox/Frontends/VBoxShell
- Timestamp:
- Apr 28, 2009 1:19:14 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 46627
- Location:
- trunk/src/VBox/Frontends/VBoxShell
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxShell/mscom/vboxshell.py
r18705 r19239 39 39 sys.exit(1) 40 40 41 ctx = {'mgr':mgr, 'vb':vbox, 'ifaces':win32com.client.constants, 42 'remote':False, 'perf':PerfCollector(vbox) } 41 # fake constants, while get resolved constants issues for real 42 # win32com.client.constants doesn't work for some reasons 43 class DummyInterfaces: pass 44 class SessionState:pass 45 46 DummyInterfaces.SessionState=SessionState() 47 DummyInterfaces.SessionState.Open = 2 48 49 ctx = {'mgr':mgr, 'vb':vbox, 'ifaces':DummyInterfaces(), 50 #'ifaces':win32com.client.constants, 51 'remote':False, 'type':'mscom' } 43 52 44 53 interpret(ctx) -
trunk/src/VBox/Frontends/VBoxShell/shellcommon.py
r18693 r19239 177 177 # we ignore exceptions to allow starting VM even if 178 178 # perf collector cannot be started 179 try: 179 if perf: 180 try: 180 181 perf.setup(['*'], [mach], 10, 15) 181 except:182 except Exception,e: 182 183 print e 183 184 if g_verbose: … … 192 193 193 194 def getMachines(ctx): 194 return ctx['vb'].getMachines() 195 # XPCOM brigde has trouble with array attributes 196 if ctx['type'] == 'xpcom': 197 return ctx['vb'].getMachines() 198 else: 199 return ctx['vb'].machines 195 200 196 201 def asState(var): … … 201 206 202 207 def guestStats(ctx,mach): 208 if not ctx['perf']: 209 return 203 210 for metric in ctx['perf'].query(["*"], [mach]): 204 211 print metric['name'], metric['values_as_string'] … … 427 434 print "Processor #%d speed: %dMHz" %(i,host.getProcessorSpeed(i)) 428 435 429 for metric in ctx['perf'].query(["*"], [host]): 436 if ctx['perf']: 437 for metric in ctx['perf'].query(["*"], [host]): 430 438 print metric['name'], metric['values_as_string'] 431 439 … … 488 496 print "Running VirtualBox version %s" %(vbox.version) 489 497 490 ctx['perf'] = PerfCollector(vbox) 498 # MSCOM doesn't work with collector yet 499 if ctx['type'] != 'mscom': 500 ctx['perf'] = PerfCollector(vbox) 501 else: 502 ctx['perf'] = None 491 503 492 504 autoCompletion(commands, ctx) … … 494 506 # to allow to print actual host information, we collect info for 495 507 # last 150 secs maximum, (sample every 10 secs and keep up to 15 samples) 496 try: 508 if ctx['perf']: 509 try: 497 510 ctx['perf'].setup(['*'], [vbox.host], 10, 15) 498 except:511 except: 499 512 pass 500 513 … … 516 529 try: 517 530 # There is no need to disable metric collection. This is just an example. 518 ctx['perf'].disable(['*'], [vbox.host]) 531 if ct['perf']: 532 ctx['perf'].disable(['*'], [vbox.host]) 519 533 except: 520 534 pass -
trunk/src/VBox/Frontends/VBoxShell/ws/vboxshell.py
r18693 r19239 32 32 33 33 ctx = {'mgr':mgr, 'vb':vbox, 'ifaces': g_reflectionInfo, 'remote': True, 34 ' perf':PerfCollector(vbox)}34 'type':'ws'} 35 35 36 36 interpret(ctx) -
trunk/src/VBox/Frontends/VBoxShell/xpcom/vboxshell.py
r18705 r19239 43 43 44 44 ctx = {'mgr':mgr, 'vb':vbox, 'ifaces':xpcom.components.interfaces, 45 'remote':False, ' perf':PerfCollector(vbox)}45 'remote':False, 'type':'xpcom' } 46 46 47 47 interpret(ctx)
Note:
See TracChangeset
for help on using the changeset viewer.