def complete_addtophdlfile(self,text,line,begidx,endidx): path = line.split(" ")[1] if path.find("/") == -1: # sub path = "" elif text.split() == "": # sub/sub/ path = "/".join(path)+"/" else: # sub/sub path = "/".join(path.split("/")[0:-1]) + "/" listdir = sy.listDirectory(path) listfile = sy.listFileType(path,"vhd") listfile.extend(listdir) return self.completelist(line,text,listfile)
def complete_load(self,text,line,begidx,endidx): """ complete load command with files under directory """ path = line.split(" ")[1] if path.find("/") == -1: # sub path = "" elif text.split() == "": # sub/sub/ path = "/".join(path)+"/" else: # sub/sub path = "/".join(path.split("/")[0:-1]) + "/" listdir = sy.listDirectory(path) listfile = sy.listFileType(path,XMLEXT[1:]) listfile.extend(listdir) return self.completelist(line,text,listfile)