def GetIconName(self): if not self.IsExpandable(): name, ext = os.path.splitext(self.path) if ext in ['.py']: #, '.pyc','.pyo']: return "python" if ext.lower() in self.imagetypes: return "image" typ = spiderFtypes.istextfile(self.path) if typ == 1: if spiderFtypes.isSpiderDocfile(self.path): return "docfile" elif spiderFtypes.isSpiderBatchfile(self.path): return "procfile" elif spiderFtypes.isSpiderProcedurefile(self.path): return "procfile" else: return "text" elif typ == -1: return "unknown" spi = spiderFtypes.isSpiderBin(self.path) if spi == "image" or spi == "Fourier": return "spider" elif spi == "volume": return "volume" return "binary" # i.e. a non-spider binary file
def dir2dialog(d): " dir is of form [dirname [ f, f, [dir], [dir],..]] " dirname = d[0] dlist = d[1] D = spiderDialog.Dialog(name=dirname, title=dirname, dir=dirname) # create instance for item in dlist: if isSpiderBatchfile(item): button = [item, "Run", [item]] D.cmdlist.append(button) return D
def isBatchFile(f): if isSpiderBatchfile(f) or isSpiderProcedurefile(f): return True else: return False