Coding style

- Moved path_colored into lscolors.
  - Made lscolors a package.
  - Moved LS_COLORS.sh and LSCOLORS into lscolors.
- Moved fill3.join into termstr so that lscolors
  can depend on termstr only.
This commit is contained in:
Andrew Hamilton 2022-05-11 11:11:37 +10:00
parent fe42fd36d4
commit 388c59aefd
13 changed files with 85 additions and 70 deletions

View file

@ -177,6 +177,15 @@ def _pad_wide_chars(str_):
return str_ if len(padded_str) == len(str_) else padded_str
def join(seperator, parts):
if parts == []:
return ""
try:
return seperator.join(parts)
except TypeError:
return TermStr(seperator).join(parts)
class TermStr(collections.UserString):
def __init__(self, data, style=CharStyle()):