Beispiel #1
0
 def start(self):
     while True:
         if self.Modules.getactivemodname() is None:
             cmd = input("[/]>")
         else:
             sys.stdout.write("[")
             sys.stdout.flush()
             colorize(self.Modules.getactivemodname(), textC.f_green)
             cmd = input("]>")
         
         if cmd == str():
             continue
         vcmd = split(cmd, ' ')
         if vcmd[0] == "exit" or vcmd[0] == "quit" or vcmd[0] == "bye":
             raise Stop()
         elif vcmd[0] == "reset":
             raise Reset()
         try:
             self.Base.dispatch(vcmd[0], self, tuple(vcmd))
         except BaseMod.ModuleNotFound:
             perror("No module found to manage "+vcmd[0])
         except KeyboardInterrupt:
             perror("Execution aborted by user!!")
         except BaseException as e:
             perror("Helix has caught an unhandled exception: %s" % str(e), ec=self.eventC)
Beispiel #2
0
 def get_installed_modules(self):
     tmp = list()
     tag = self.db.execute("SELECT TAGGED FROM INSTALLED;").fetchall()
     for row in tag:
         spl = split(row[0], ",")
         for mod in spl:
             tmp.append(mod)
     return tuple(tmp)
Beispiel #3
0
 def search(self, tag):
     tmp = list()
     tag = self.db.execute("SELECT TAGGED FROM INSTALLED WHERE INSTR(tag,'%s');" % tag).fetchall()
     for row in tag:
         spl = split(row[0], ",")
         for mod in spl:
             tmp.append(mod)
     return tuple(tmp)
Beispiel #4
0
 def stringtolist(_str):
     return split(_str, ",")