Пример #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")