def run(tokens): global current if current == "null": raise exceptions.LucidusException("No module loaded!") return utilities.spool("Running module '" + current.__str__() + "'") current.run()
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")
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()
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
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")
def quit(tokens): utilities.spool("Exiting Lucidus. Bye!") sys.exit(0)
def check(tokens): global current if current == "null": raise exceptions.LucidusException("No module loaded!") utilities.spool("Checking module '" + current.__str__() + "'") current.check()
def setg(tokens): global current utilities.spool("Setting global '" + tokens[1] + "' to '" + tokens[2] + "'") globals.setGlobal(tokens[1], tokens[2])
def set(tokens): global current utilities.spool("Setting attribute '" + tokens[1] + "' to '" + tokens[2] + "'") current.setAttribute(tokens[1], tokens[2])
def unload(tokens): global current utilities.spool("Unloading module '" + current.__str__() + "'") current = "null"
def load(tokens): global current utilities.spool("Loading module '" + tokens[1] + "'") current = utilities.import_lucidus_module(tokens[1])()
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")