(self)
Returns a preview of the data
Returns a preview of the data
Returns a preview of the data
def peek(self):
        """
        Returns a preview of the data
        """
        try:
            target = self.get_path()
            lines = open(target, 'rt').readlines()
            if len(lines) == 1:
                target = lines[0]
                return util.smart_preview(target)
            else:
                data_dir = self.get_data_dir()
                rels = [os.path.relpath(path, data_dir) for path in lines]
                return "".join(rels)
        except Exception as exc:
            return f"Error :{exc}"
def peek ( self ) : try : target = self . get_path ( ) lines = open ( target , 'rt' ) . readlines ( ) if len ( lines ) == 1 : target = lines [ 0 ] return util . smart_preview ( target ) else : data_dir = self . get_data_dir ( ) rels = [ os . path . relpath ( path , data_dir ) for path in lines ] return "" . join ( rels ) except Exception as exc : return f"Error :{exc}"