VirtualBox

忽略:
時間撮記:
2008-9-24 下午02:32:54 (16 年 以前)
作者:
vboxsync
訊息:
  • better macro docs
  • implemented eval command in Vbox shell
檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/libs/xpcom18a4/python/sample/shellcommon.py

    r12411 r12689  
    300300   return 0
    301301
     302
     303def evalCmd(ctx, args):
     304   expr = ' '.join(args[1:])
     305   try:
     306        exec expr
     307   except Exception, e:
     308        print 'failed: ',e
     309        if g_verbose:
     310            traceback.print_exc()
     311   return 0
     312
    302313aliases = {'s':'start', 
    303314           'i':'info',
     
    318329            'aliases':['Shows aliases', aliasesCmd],
    319330            'verbose':['Toggle verbosity', verboseCmd],
    320             'setvar':['Set VMs variable: "setvar Fedora BIOSSettings.ACPIEnabled True"', setvarCmd],
     331            'setvar':['Set VMs variable: setvar Fedora BIOSSettings.ACPIEnabled True', setvarCmd],
     332            'eval':['Evaluate arbitrary Python construction: eval for m in getMachines(ctx): print m.name,"has",m.memorySize,"M"', evalCmd],
    321333            'quit':['Exits', quitCmd],
    322334            'host':['Show host information', hostCmd]}
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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