

def _human_st_mode(self, mode):
    'Convert the st_mode returned by stat in human readable (ls-like) format'
    hr = ''
    if os.path.stat.S_ISREG(mode):
        hr = '-'
    elif os.path.stat.S_ISLNK(mode):
        hr = 'l'
    elif os.path.stat.S_ISSOCK(mode):
        hr = 's'
    elif os.path.stat.S_ISDIR(mode):
        hr = 'd'
    elif os.path.stat.S_ISBLK(mode):
        hr = 'b'
    elif os.path.stat.S_ISFIFO(mode):
        hr = 'p'
    elif os.path.stat.S_ISCHR(mode):
        hr = 'c'
    else:
        hr = '-'
    for who in ('USR', 'GRP', 'OTH'):
        for perm in ('R', 'W', 'X'):
            if (mode & getattr(os.path.stat, (('S_I' + self) + who))):
                hr += perm.lower()
            else:
                hr += '-'
    return hr

dataset/ETHPy150Open ziirish/burp-ui/burpui/misc/backend/burp2.py Burp._human_st_mode/VarMisuse@202/295 `perm`->`self`