def _massage_stats(request, stats):
 path = stats['path']
 normalized = request.fs.normpath(path)
 return {'path': normalized, 'name': stats['name'], 'stats': stats.to_json_dict(), 'mtime': (datetime.fromtimestamp(stats['mtime']).strftime('%B %d, %Y %I:%M %p') if stats['mtime'] else ''), 'humansize': filesizeformat(stats['size']), 'type': filetype(stats['mode']), 'rwx': rwx(stats['mode'], stats['aclBit']), 'mode': stringformat(stats['mode'], 'o'), 'url': reverse('filebrowser.views.view', kwargs=dict(path=normalized)), 'is_sentry_managed': request.fs.is_sentry_managed(path)}

def _massage_stats ( request , stats ) : path = stats [ 'path' ] normalized = request . fs . normpath ( path ) return { 'path' : normalized , 'name' : stats [ 'name' ] , 'stats' : stats . to_json_dict ( ) , 'mtime' : ( datetime . fromtimestamp ( stats [ 'mtime' ] ) . strftime ( '%B %d, %Y %I:%M %p' ) if stats [ 'mtime' ] else '' ) , 'humansize' : filesizeformat ( stats [ 'size' ] ) , 'type' : filetype ( stats [ 'mode' ] ) , 'rwx' : rwx ( stats [ 'mode' ] , stats [ 'aclBit' ] ) , 'mode' : stringformat ( stats [ 'mode' ] , 'o' ) , 'url' : reverse ( 'filebrowser.views.view' , kwargs = dict ( path = normalized ) ) , 'is_sentry_managed' : request . fs . is_sentry_managed ( path ) }
massage a stats record as returned by the filesystem implementation into the format that the views would like it in .