def __str__(self):
if self.st_mode is not None:<EOL><INDENT>kind = stat.S_IFMT(self.st_mode)<EOL>if kind == stat.S_IFIFO:<EOL><INDENT>ks = '<STR_LIT:p>'<EOL><DEDENT>elif kind == stat.S_IFCHR:<EOL><INDENT>ks = '<STR_LIT:c>'<EOL><DEDENT>elif kind == stat.S_IFDIR:<EOL><INDENT>ks = '<STR_LIT:d>'<EOL><DEDENT>elif kind == stat.S_IFBLK:<EOL><INDENT>ks = '<STR_LIT:b>'<EOL><DEDENT>elif kind == stat.S_IFREG:<EOL><INDENT>ks = '<STR_LIT:->'<EOL><DEDENT>elif kind == stat.S_IFLNK:<EOL><INDENT>ks = '<STR_LIT:l>'<EOL><DEDENT>elif kind == stat.S_IFSOCK:<EOL><INDENT>ks = '<STR_LIT:s>'<EOL><DEDENT>else:<EOL><INDENT>ks = '<STR_LIT:?>'<EOL><DEDENT>ks += self._rwx((self.st_mode & <NUM_LIT>) >> <NUM_LIT:6>, self.st_mode & stat.S_ISUID)<EOL>ks += self._rwx((self.st_mode & <NUM_LIT>) >> <NUM_LIT:3>, self.st_mode & stat.S_ISGID)<EOL>ks += self._rwx(self.st_mode & <NUM_LIT:7>, self.st_mode & stat.S_ISVTX, True)<EOL><DEDENT>else:<EOL><INDENT>ks = '<STR_LIT>'<EOL><DEDENT>if (self.st_mtime is None) or (self.st_mtime == <NUM_LIT>):<EOL><INDENT>datestr = '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>if abs(time.time() - self.st_mtime) > <NUM_LIT>:<EOL><INDENT>datestr = time.strftime('<STR_LIT>', time.localtime(self.st_mtime))<EOL><DEDENT>else:<EOL><INDENT>datestr = time.strftime('<STR_LIT>', time.localtime(self.st_mtime))<EOL><DEDENT><DEDENT>filename = getattr(self, '<STR_LIT:filename>', '<STR_LIT:?>')<EOL>uid = self.st_uid<EOL>gid = self.st_gid<EOL>if uid is None:<EOL><INDENT>uid = <NUM_LIT:0><EOL><DEDENT>if gid is None:<EOL><INDENT>gid = <NUM_LIT:0><EOL><DEDENT>return '<STR_LIT>' % (ks, uid, gid, self.st_size, datestr, filename)<EOL>
create a unix-style long description of the file (like ls -l)