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

@ -40,19 +40,10 @@ def appearance_dimensions(appearance):
return 0, 0
def join(seperator, parts):
if parts == []:
return ""
try:
return seperator.join(parts)
except TypeError:
return termstr.TermStr(seperator).join(parts)
def join_horizontal(appearances):
heights = set(len(appearance) for appearance in appearances)
assert len(heights) == 1, heights
return [join("", parts) for parts in zip(*appearances)]
return [termstr.join("", parts) for parts in zip(*appearances)]
def even_widths(column_widgets, width):

View file

@ -6,6 +6,7 @@ import unittest
import fill3
import fill3.terminal as terminal
import termstr
class WidgetTests(unittest.TestCase):
@ -14,7 +15,7 @@ class WidgetTests(unittest.TestCase):
TEXT_B = fill3.Text("B")
def assert_string(self, appearance, expected_string):
self.assertEqual(str(fill3.join("\n", appearance)), expected_string)
self.assertEqual(str(termstr.join("\n", appearance)), expected_string)
def test_rows_widget(self):
rows = fill3.Row([self.TEXT_A, self.TEXT_B])