コード例 #1
0
ファイル: views.py プロジェクト: anutron/hue
def _massage_stats(request, stats):
  """
  Massage a stats record as returned by the filesystem implementation
  into the format that the views would like it in.
  """
  normalized = normpath(stats['path'])
  return {
    'path': normalized,
    'name': posixpath.basename(stats['path']),
    'stats': stats,
    'type': filetype(stats['mode']),
    'rwx': rwx(stats['mode']),
    'url': make_absolute(request, "view", dict(path=urlquote(normalized))),
  }
コード例 #2
0
ファイル: views.py プロジェクト: zhuwchicago/hue
def _massage_stats(request, stats):
    """
    Massage a stats record as returned by the filesystem implementation
    into the format that the views would like it in.
    """
    path = stats["path"]
    normalized = Hdfs.normpath(path)
    return {
        "path": normalized,
        "name": posixpath.basename(path),
        "stats": stats.to_json_dict(),
        "type": filetype(stats["mode"]),
        "rwx": rwx(stats["mode"]),
        "url": make_absolute(request, "view", dict(path=urlquote(normalized))),
    }
コード例 #3
0
def _massage_stats(request, stats):
    """
  Massage a stats record as returned by the filesystem implementation
  into the format that the views would like it in.
  """
    path = stats['path']
    normalized = normpath(path)
    return {
        'path': normalized,
        'name': posixpath.basename(path),
        'stats': stats,
        'type': filetype(stats['mode']),
        'rwx': rwx(stats['mode']),
        'url': make_absolute(request, "view", dict(path=urlquote(normalized))),
    }
コード例 #4
0
ファイル: views.py プロジェクト: mobilipia/hue
def _massage_stats(request, stats):
    """
    Massage a stats record as returned by the filesystem implementation
    into the format that the views would like it in.
    """
    path = stats['path']
    normalized = Hdfs.normpath(path)
    return {
        'path': normalized,
        'name': stats['name'],
        'stats': stats.to_json_dict(),
        'humansize': filesizeformat(stats['size']),
        'type': filetype(stats['mode']),
        'rwx': rwx(stats['mode']),
        'mode': stringformat(stats['mode'], "o"),
        'url': make_absolute(request, "view", dict(path=urlquote(normalized))),
        }
コード例 #5
0
def _massage_stats(request, stats):
    """
    Massage a stats record as returned by the filesystem implementation
    into the format that the views would like it in.
    """
    path = stats['path']
    normalized = Hdfs.normpath(path)
    return {
        'path': normalized,
        'name': stats['name'],
        'stats': stats.to_json_dict(),
        'humansize': filesizeformat(stats['size']),
        'type': filetype(stats['mode']),
        'rwx': rwx(stats['mode']),
        'mode': stringformat(stats['mode'], "o"),
        'url': make_absolute(request, "view", dict(path=urlquote(normalized))),
    }
コード例 #6
0
ファイル: views.py プロジェクト: HaNeul-Kim/hue
def _massage_stats(request, stats):
    """
    Massage a stats record as returned by the filesystem implementation
    into the format that the views would like it in.
    """
    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'),
        'humansize': filesizeformat(stats['size']),
        'type': filetype(stats['mode']),
        'rwx': rwx(stats['mode'], stats['aclBit']),
        'mode': stringformat(stats['mode'], "o"),
        'url': make_absolute(request, "view", dict(path=normalized)),
        'is_sentry_managed': request.fs.is_sentry_managed(path)
    }
コード例 #7
0
ファイル: views.py プロジェクト: chengc017/hue
def _massage_stats(request, stats):
    """
    Massage a stats record as returned by the filesystem implementation
    into the format that the views would like it in.
    """
    path = stats['path']
    normalized = Hdfs.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'),
        'humansize': filesizeformat(stats['size']),
        'type': filetype(stats['mode']),
        'rwx': rwx(stats['mode'], stats['aclBit']),
        'mode': stringformat(stats['mode'], "o"),
        'url': make_absolute(request, "view", dict(path=urlquote(normalized))),
        'is_sentry_managed': request.fs.is_sentry_managed(path)
    }