removed color from filepath

This commit is contained in:
stephentoth 2024-02-26 17:39:38 -06:00
parent 771267eb50
commit b2621a891f
1 changed files with 3 additions and 2 deletions

5
ls.py
View File

@ -38,10 +38,11 @@ def colorize(text, color):
def gen_color_file_string(filepath, mode):
path, file = os.path.split(filepath)
perms = parse_permissions(mode)
color = perms['color']
filestring = colorize(filepath, color)
# dircolors?
filestring = f"{path and path+'/'}{colorize(file, color)}"
# dircolors var?
if perms['char'] == 'l':
pointfile = os.readlink(filepath)
pointfilereal = os.path.join(os.path.dirname(filepath), os.readlink(filepath))