ocarina/src/core/cline/run.py

30 lines
593 B
Python

#! /usr/bin/python
# To change this template, choose Tools | Templates
# and open the template in the editor.
__author__="bjschuma"
__date__ ="$Dec 19, 2009 11:38:46 PM$"
from manager import manager
import settings
from bt.message import write
# Check for valid input
def run(input):
prompt = settings.get("prompt")
input = input[len(prompt):].strip()
if len(input) == 0:
return prompt
split = input.split(' ')
if len(split)>1:
manager.run(split[0],split[1:])
else:
manager.run(input)
# Account for the prompt changing when the manager runs
return settings.get("prompt")