Last change
on this file since 19076 was 18705, checked in by vboxsync, 16 years ago |
SDK: typos
|
-
Property svn:eol-style
set to
native
-
Property svn:keywords
set to
Author Date Id Revision
|
File size:
1.6 KB
|
Line | |
---|
1 | #!python
|
---|
2 | #
|
---|
3 | #################################################################################
|
---|
4 | # This program is a simple interactive shell for VirtualBox. You can query #
|
---|
5 | # information and issue commands from a simple command line. #
|
---|
6 | # #
|
---|
7 | # It also provides you with examples on how to use VirtualBox's Python API. #
|
---|
8 | # This shell is even somewhat documented and supports TAB-completion and #
|
---|
9 | # history if you have Python readline installed. #
|
---|
10 | # #
|
---|
11 | # Enjoy. #
|
---|
12 | #################################################################################
|
---|
13 | #
|
---|
14 | #
|
---|
15 |
|
---|
16 | import sys, os
|
---|
17 | from win32com import universal
|
---|
18 | from win32com.client import gencache, DispatchWithEvents, Dispatch
|
---|
19 | from win32com.client import constants, getevents
|
---|
20 | import win32com.server.register
|
---|
21 | import win32com
|
---|
22 | import pythoncom
|
---|
23 | import win32api
|
---|
24 | import traceback
|
---|
25 |
|
---|
26 | from shellcommon import interpret
|
---|
27 |
|
---|
28 | class LocalManager:
|
---|
29 | def getSessionObject(self, vb):
|
---|
30 | return win32com.client.Dispatch("{3C02F46D-C9D2-4f11-A384-53F0CF917214}")
|
---|
31 |
|
---|
32 | vbox = None
|
---|
33 | mgr = LocalManager()
|
---|
34 | try:
|
---|
35 | vbox = win32com.client.Dispatch("{B1A7A4F2-47B9-4A1E-82B2-07CCD5323C3F}")
|
---|
36 | except Exception,e:
|
---|
37 | print "COM exception: ",e
|
---|
38 | traceback.print_exc()
|
---|
39 | sys.exit(1)
|
---|
40 |
|
---|
41 | ctx = {'mgr':mgr, 'vb':vbox, 'ifaces':win32com.client.constants,
|
---|
42 | 'remote':False, 'perf':PerfCollector(vbox) }
|
---|
43 |
|
---|
44 | interpret(ctx)
|
---|
45 |
|
---|
46 | del vbox
|
---|
Note:
See
TracBrowser
for help on using the repository browser.