- Timestamp:
- Jul 13, 2009 8:10:29 AM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 49969
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxShell/vboxshell.py
r21419 r21517 30 30 import traceback 31 31 import shlex 32 import time 32 33 33 34 # Simple implementation of IConsoleCallback, one can use it as skeleton … … 276 277 277 278 def monitorGuest(ctx, machine, console, dur): 278 import time279 279 cb = ctx['global'].createCallback('IConsoleCallback', GuestMonitor, machine) 280 280 console.registerCallback(cb) … … 293 293 294 294 def monitorVbox(ctx, dur): 295 import time296 295 vbox = ctx['vb'] 297 296 cb = ctx['global'].createCallback('IVirtualBoxCallback', VBoxMonitor, vbox) … … 413 412 414 413 def infoCmd(ctx,args): 415 import time416 414 if (len(args) < 2): 417 415 print "usage: info [vmname|uuid]" … … 736 734 return 0 737 735 736 def sleepCmd(ctx, args): 737 if (len(args) != 2): 738 print "usage: sleep <secs>" 739 return 0 740 741 time.sleep(float(args[1])) 738 742 739 743 aliases = {'s':'start', … … 770 774 'reloadExt':['Reload custom extensions: reloadExt', reloadExtCmd, 0], 771 775 'runScript':['Run VBox script: runScript script.vbox', runScriptCmd, 0], 776 'sleep':['Sleep for specified number of seconds: sleep <secs>', sleepCmd, 0], 772 777 } 773 778 774 def runCommand(ctx, cmd): 775 if len(cmd) == 0: return 0 776 args = split_no_quotes(cmd) 777 if len(args) == 0: return 0 779 def runCommandArgs(ctx, args): 778 780 c = args[0] 779 781 if aliases.get(c, None) != None: … … 784 786 return 0 785 787 return ci[1](ctx, args) 788 789 790 def runCommand(ctx, cmd): 791 if len(cmd) == 0: return 0 792 args = split_no_quotes(cmd) 793 if len(args) == 0: return 0 794 return runCommandArgs(ctx, args) 786 795 787 796 # … … 853 862 pass 854 863 864 def runCommandCb(ctx, cmd, args): 865 args.insert(0, cmd) 866 return runCommandArgs(ctx, args) 867 855 868 def main(argv): 856 869 style = None … … 880 893 'ifaces':g_virtualBoxManager.constants, 881 894 'remote':g_virtualBoxManager.remote, 882 'type':g_virtualBoxManager.type 895 'type':g_virtualBoxManager.type, 896 'run':runCommandCb 883 897 } 884 898 interpret(ctx)
Note:
See TracChangeset
for help on using the changeset viewer.