def que(self, signal): if signal[0] == 102: return ["System Shell ready. Type help for help."] if signal[0] == 101: return if signal[0] == 100: self.cmd = ((signal[1]).split(" "))[0].lower() if self.cmd == "taskman": self.qstart = "taskman" return ["Launching Taskman"] if self.cmd == "console": self.qstart = "console" return ["Launching Console"] if self.cmd == "shtest": return ["Shell working."] if self.cmd == "help": return vmui.listline(systemshellhelp) #directory navigation if self.cmd == "dir" or self.cmd == "ls": return libfilevirtual.dirlist(self.pathlist) if self.cmd == "cd..": self.pathlist = libfilevirtual.dir_cdup(self.pathlist) self.pathstr = os.path.join(*self.pathlist) self.title = "SYSTEM - " + self.pathstr if self.cmd == "cd": try: self.dirstr = ((signal[1]).split(" "))[1] except IndexError: return ["Error: please specify path!"] self.tmplist = libfilevirtual.dir_cd(self.pathlist, self.dirstr) if self.tmplist == None: return ["Error: Path Not Found"] else: self.pathlist = self.tmplist self.pathstr = os.path.join(*self.pathlist) self.title = "SYSTEM - " + self.pathstr #task listing if self.cmd == "tasks": self.retlist = [] for self.task in activewids: self.retlist.extend([ ("Name: " + self.task.title + " | Order: " + str(self.task.wo) + " | taskid: " + str(self.task.taskid)) ]) return self.retlist
subprocess.Popen([ "python", "MK2-TOOLS.py", "imgview", (os.path.join(iterfilesq, f.filename)) ]) if f.ftype == "text": subprocess.Popen([ "python", "MK2-TOOLS.py", "textview", (os.path.join(iterfilesq, f.filename)) ]) #special directory handler if f.ftype == "dir": hudupdate = 1 if f.pane == 1: listyoff = 110 scupdate = 1 pathlist = libfilevirtual.dir_cd( pathlist, f.filename) iterfiles = os.path.join(*pathlist) pygame.display.set_caption( ("fileview - " + iterfiles), ("fileview - " + iterfiles)) break else: listyoff2 = 110 scupdate = 1 pathlist2 = libfilevirtual.dir_cd( pathlist2, f.filename) iterfiles2 = os.path.join(*pathlist2) #pygame.display.set_caption(("fileview - " + iterfiles), ("fileview - " + iterfiles)) break #scroll wheel handling
def click(self, event): #filter menu click processing if self.filmenu==1: if event.button==1: if self.filmenubx.collidepoint(event.pos): for self.itm in self.filmenulist: if self.itm.box.collidepoint(event.pos): self.filterflg=self.itm.retstring self.filmenu=0 self.scup=1 return else: self.filmenu=0 if event.button==4: if event.pos[0]>150: if self.yoff<0: self.yoff += 30 #scupdate=1 self.scup=1 return if event.button==5: if event.pos[0]>150: if self.texty>self.widy: self.yoff -= 30 #scupdate=1 self.scup=1 if self.yoff>0: self.yoff=0 #scupdate=1 self.scup=1 return #run view switch if self.sw1bx.collidepoint(event.pos)==1 and event.button==1: self.scup=1 if self.runexec==0: self.runexec=1 else: self.runexec=0 #filter button click processing if self.filbtn.collidepoint(event.pos)==1 and event.button==1: self.filmenu=1 #tile click processor for self.f in self.clicklist: if self.f.box.collidepoint(event.pos)==1 and event.button==1: #program launchers if self.runexec==0: if self.f.ftype=="trom": subprocess.Popen(["python", "MK2-RUN.py", (os.path.join(self.iterfiles, self.f.filename))]) if self.f.ftype=="streg": subprocess.Popen(["python", "MK2-RUN.py", (os.path.join(self.iterfiles, self.f.filename))]) else: if self.f.ftype=="trom": subprocess.Popen(["python", "MK2-TOOLS.py", "codeview", (os.path.join(self.iterfiles, self.f.filename))]) if self.f.ftype=="streg": subprocess.Popen(["python", "MK2-TOOLS.py", "codeview", (os.path.join(self.iterfiles, self.f.filename))]) if self.f.ftype=="tasm": subprocess.Popen(["python", "MK2-TOOLS.py", "codeview", (os.path.join(self.iterfiles, self.f.filename))]) if self.f.ftype=="log": subprocess.Popen(["python", "MK2-TOOLS.py", "codeview", (os.path.join(self.iterfiles, self.f.filename))]) if self.f.ftype=="dmp": subprocess.Popen(["python", "MK2-TOOLS.py", "codeview", (os.path.join(self.iterfiles, self.f.filename))]) if self.f.ftype=="img": subprocess.Popen(["python", "MK2-TOOLS.py", "imgview", (os.path.join(self.iterfiles, self.f.filename))]) if self.f.ftype=="text": subprocess.Popen(["python", "MK2-TOOLS.py", "textview", (os.path.join(self.iterfiles, self.f.filename))]) #special directory handler if self.f.ftype=="dir": self.scup=1 self.yoff=0 #home directory (SBTCVM's repository root directory) self.argument=libfilevirtual.dir_cd(self.argument, self.f.filename) self.iterfiles=os.path.join(*self.argument) self.title="Fileman: " + self.iterfiles return