示例#1
0
def run(tokens):
    global current
    if current == "null":
        raise exceptions.LucidusException("No module loaded!")
        return
    utilities.spool("Running module '" + current.__str__() + "'")
    current.run()
示例#2
0
def attributes_handler(tokens):
    global current
    if current == "null":
        raise exceptions.LucidusException("No module loaded!")
        return
    utilities.spool("Name\t\t\t\t\t\t\tDescription\t\t\t\t\t\t\tValue\n")
    at = current.getAttributes()
    for k in at:
        utilities.spool(k + "\t\t\t\t\t" + at[k].description + "\t\t\t\t\t" + at[k].data + "\n")
示例#3
0
def exec_handler(tokens):
    utilities.spool("Executing file '" + tokens[1] + "'")
    try:
        f = open(tokens[1])
        parse(f)
    except:
        raise exceptions.LucidusException("Could not execute file `" + tokens[1] + "'")
    finally:
        f.close()
示例#4
0
def loop(tokens):
    global current
    if current == "null":
        raise exceptions.LucidusException("No module loaded!")
        return
    utilities.spool("Running module '" + current.__str__() + "'")
    for i in range(2, len(tokens)):
        current.setAttribute(tokens[1], tokens[i])
        try:
            current.run()
        except(exceptions.LucidusException) as error:
            if globals.getGlobal("stoponexception") == "true":
                print error
                break
            else:
                pass
示例#5
0
def info_handler(tokens):
    global current
    if current == "null":
        raise exceptions.LucidusException("No module loaded!")
        return
    info = current.getInfo() 
    utilities.spool("Name: " + info["name"] + " (" + current.__str__() + ") " + "\n")
    utilities.spool("Author: " + info["author"] + "\n")
    utilities.spool("Description: " + info["description"] + "\n")
    utilities.spool("Targets: " + info["targets"] + "\n")
示例#6
0
def quit(tokens):
    utilities.spool("Exiting Lucidus. Bye!")
    sys.exit(0)
示例#7
0
def check(tokens):
    global current
    if current == "null":
        raise exceptions.LucidusException("No module loaded!")
    utilities.spool("Checking module '" + current.__str__() + "'")
    current.check()
示例#8
0
def setg(tokens):
    global current
    utilities.spool("Setting global '" + tokens[1] + "' to '" + tokens[2] + "'")
    globals.setGlobal(tokens[1], tokens[2])
示例#9
0
def set(tokens):
    global current
    utilities.spool("Setting attribute '" + tokens[1] + "' to '" + tokens[2] + "'")
    current.setAttribute(tokens[1], tokens[2])
示例#10
0
def unload(tokens):
    global current
    utilities.spool("Unloading module '" + current.__str__() + "'")
    current = "null"
示例#11
0
def load(tokens):
    global current
    utilities.spool("Loading module '" + tokens[1] + "'")
    current = utilities.import_lucidus_module(tokens[1])()
示例#12
0
def globals_handler(tokens):
    utilities.spool("Name\t\t\t\t\t\t\tDescription\t\t\t\t\t\t\tValue\n")
    gl = globals.getGlobals()
    for k in gl:
        utilities.spool(k + "\t\t\t\t\t" + gl[k].description + "\t\t\t\t\t" + gl[k].data + "\n")