From b2621a891f5362698c5f3757643228066fdabf71 Mon Sep 17 00:00:00 2001 From: stephentoth Date: Mon, 26 Feb 2024 17:39:38 -0600 Subject: [PATCH] removed color from filepath --- ls.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ls.py b/ls.py index 6f1929b..53bd26c 100755 --- a/ls.py +++ b/ls.py @@ -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))