54 lines
987 B
Python
54 lines
987 B
Python
#! /usr/bin/python
|
|
|
|
__author__="bjschuma"
|
|
__date__ ="$Dec 18, 2009 12:08:57 AM$"
|
|
|
|
|
|
global name, app, type, path, opt
|
|
name = "cli"
|
|
app = "scion"
|
|
type = "core"
|
|
path = ""
|
|
opt = []
|
|
|
|
from bt.message import *
|
|
import cline.loop
|
|
import cline.addch
|
|
import cline.message
|
|
#import settings
|
|
from bt.needle import Needle
|
|
|
|
|
|
|
|
# Called every time the plugin is enabled
|
|
def open():
|
|
write("Starting CLI", True)
|
|
|
|
# Tell settings to run this loop
|
|
settings.set("loop",cline.loop.loop)
|
|
settings.set("loopquit",cline.loop.quit)
|
|
|
|
# Initialize a dictionary for key press inputs
|
|
settings.set("keyinput", dict())
|
|
settings.get("keyinput")[127] = cline.addch.backspace
|
|
settings.get("keyinput")[10] = cline.addch.enter
|
|
|
|
|
|
|
|
|
|
# Called every time the plugin is stopped
|
|
def close():
|
|
cline.loop.quit()
|
|
write("CLI has been stopped", True)
|
|
settings.delete("keyinput")
|
|
|
|
|
|
def help():
|
|
return "This is a simple command line interface"
|
|
|
|
|
|
|
|
# Called when the plugin needs to perform some action
|
|
def run(args=None):
|
|
pass
|