VirtualBox

source: vbox/trunk/src/VBox/Frontends/VBoxShell/mscom/vboxshell.py@ 19076

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
16import sys, os
17from win32com import universal
18from win32com.client import gencache, DispatchWithEvents, Dispatch
19from win32com.client import constants, getevents
20import win32com.server.register
21import win32com
22import pythoncom
23import win32api
24import traceback
25
26from shellcommon import interpret
27
28class LocalManager:
29 def getSessionObject(self, vb):
30 return win32com.client.Dispatch("{3C02F46D-C9D2-4f11-A384-53F0CF917214}")
31
32vbox = None
33mgr = LocalManager()
34try:
35 vbox = win32com.client.Dispatch("{B1A7A4F2-47B9-4A1E-82B2-07CCD5323C3F}")
36except Exception,e:
37 print "COM exception: ",e
38 traceback.print_exc()
39 sys.exit(1)
40
41ctx = {'mgr':mgr, 'vb':vbox, 'ifaces':win32com.client.constants,
42 'remote':False, 'perf':PerfCollector(vbox) }
43
44interpret(ctx)
45
46del vbox
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette