Skip to content

Commit 91dc957

Browse files
authored
Merge pull request #6 from leonardbinet/ci
add 2.7 for retro-compatibility
2 parents 8d24f3d + 6b694be commit 91dc957

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

.github/workflows/python-package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: ubuntu-latest
1616
strategy:
1717
matrix:
18-
python-version: [3.5, 3.6, 3.7, 3.8]
18+
python-version: [2.7, 3.5, 3.6, 3.7, 3.8]
1919

2020
steps:
2121
- uses: actions/checkout@v2

lighttree/interactive.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ def __getitem__(self, item):
192192
r._expand_attrs(depth=1)
193193
return r
194194

195-
def __str__(self):
195+
def _show(self):
196196
tree_repr = self._tree.show()
197197
if self._root_path is None:
198198
return "<%s>\n%s" % (
@@ -205,3 +205,6 @@ def __str__(self):
205205
text(current_path),
206206
text(tree_repr),
207207
)
208+
209+
def __str__(self):
210+
return self._show()

tests/test_interactive.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ class InteractiveTree(TreeBasedObj):
192192

193193
# test representations
194194
self.assertEqual(
195-
obj.__str__(),
195+
obj._show(),
196196
"""<SomeCoolTree>
197197
root
198198
├── a
@@ -205,7 +205,7 @@ class InteractiveTree(TreeBasedObj):
205205
""",
206206
)
207207
self.assertEqual(
208-
a.__str__(),
208+
a._show(),
209209
"""<SomeCoolTree subpart: a>
210210
a
211211
├── a1
@@ -215,7 +215,7 @@ class InteractiveTree(TreeBasedObj):
215215
""",
216216
)
217217
self.assertEqual(
218-
a.a1.__str__(),
218+
a.a1._show(),
219219
"""<SomeCoolTree subpart: a.a1>
220220
a1
221221
├── a11

0 commit comments

Comments
 (0)