vbox的更動 11816 路徑 trunk/src/libs/xpcom18a4/python/sample
- 時間撮記:
- 2008-8-29 下午01:39:52 (16 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/libs/xpcom18a4/python/sample/vboxshell.py
r11746 r11816 1 1 #!/usr/bin/python 2 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' Python API. 8 # This shell is even somewhat documented and supports TAB-completion and history#9 # if you have Python readline installed.#10 # 11 # Enjoy. 12 ################################################################################# ###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' 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 13 # 14 14 # To make it work, the following variables have to be set. … … 21 21 # To allow library resolution 22 22 # export LD_LIBRARY_PATH=$VBOX_PROGRAM_PATH 23 # Additionally, on 64-bit Solaris, you need to use 64-bit Python from /usr/bin/amd64/python 24 # and due to quirks in native modules loading of Python do the following: 23 # Additionally, on 64-bit Solaris, you need to use 64-bit Python from 24 # /usr/bin/amd64/python and due to quirks in native modules loading of 25 # Python do the following: 25 26 # mkdir $VBOX_PROGRAM_PATH/64 26 27 # ln -s $VBOX_PROGRAM_PATH/VBoxPython.so $VBOX_PROGRAM_PATH/64/VBoxPython.so … … 81 82 if word[:n] == text: 82 83 matches.append(word) 84 word = str(m.id)[1:-1] 85 if word[:n] == text: 86 matches.append(word) 83 87 84 88 return matches … … 165 169 mach = None 166 170 for m in getMachines(ctx): 167 if m.id == idor m.name == id:171 if str(m.id) == '{'+id+'}' or m.name == id: 168 172 mach = m 169 173 break … … 175 179 return None 176 180 id = args[1] 177 return machById(ctx, id) 181 m = machById(ctx, id) 182 if m == None: 183 print "Machine '%s' is unknown, use list command to find available machines" %(id) 184 return m 178 185 179 186 def helpCmd(ctx, args): … … 227 234 type = args[2] 228 235 else: 229 type = " gui"236 type = "GUI/Qt4" 230 237 startVm(ctx['mgr'], ctx['vb'], mach, type) 231 238 return 0
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器