def dhist(self, parameter_s=''): """Print your history of visited directories. %dhist -> print full history\\ %dhist n -> print last n entries only\\ %dhist n1 n2 -> print entries between n1 and n2 (n1 not included)\\ This history is automatically maintained by the %cd command, and always available as the global list variable _dh. You can use %cd -<n> to go to directory number <n>. Note that most of time, you should view directory history by entering cd -<TAB>. """ dh = self.shell.user_ns['_dh'] if parameter_s: try: args = map(int,parameter_s.split()) except: self.arg_err(self.dhist) return if len(args) == 1: ini,fin = max(len(dh)-(args[0]),0),len(dh) elif len(args) == 2: ini,fin = args else: self.arg_err(self.dhist) return else: ini,fin = 0,len(dh) nlprint(dh, header = 'Directory history (kept in _dh)', start=ini,stop=fin)
def dhist(self, parameter_s=''): """Print your history of visited directories. %dhist -> print full history\\ %dhist n -> print last n entries only\\ %dhist n1 n2 -> print entries between n1 and n2 (n1 not included)\\ This history is automatically maintained by the %cd command, and always available as the global list variable _dh. You can use %cd -<n> to go to directory number <n>. Note that most of time, you should view directory history by entering cd -<TAB>. """ dh = self.shell.user_ns['_dh'] if parameter_s: try: args = list(map(int,parameter_s.split())) except: self.arg_err(self.dhist) return if len(args) == 1: ini,fin = max(len(dh)-(args[0]),0),len(dh) elif len(args) == 2: ini,fin = args else: self.arg_err(self.dhist) return else: ini,fin = 0,len(dh) nlprint(dh, header = 'Directory history (kept in _dh)', start=ini,stop=fin)
def print_slist(arg): """ Prettier (non-repr-like) and more informative printer for SList """ print "SList (.p, .n, .l, .s, .grep(), .fields(), sort() available):" if hasattr(arg, 'hideonce') and arg.hideonce: arg.hideonce = False return nlprint(arg)