Skip to content

Commit

Permalink
fix: color error in python2, add test file.
Browse files Browse the repository at this point in the history
  • Loading branch information
zlj-zz committed Jul 29, 2021
1 parent 2c00026 commit 12c28f3
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pygittools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,10 @@ def bg(cls, *args):
return cls.escape_color(hexa=args[0], depth="bg")


if not PYTHON3:
Color.TRUE_COLOR = True


class Fx(object):
"""Text effects
* trans(string: str): Replace whitespace with escape move right to not overwrite background behind whitespace.
Expand Down
27 changes: 27 additions & 0 deletions tests/test_python2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

echo $(pwd)

PY2=$(whereis python2)
echo ${PY2}

Project=pygittools

${PY2} ${Project}/__init__.py
Sleep 2
${PY2} ${Project}/__init__.py -s
Sleep 2
${PY2} ${Project}/__init__.py -t
Sleep 2
${PY2} ${Project}/__init__.py -S Branch
Sleep 2
${PY2} ${Project}/__init__.py -h
Sleep 2
${PY2} ${Project}/__init__.py -f
Sleep 2
${PY2} ${Project}/__init__.py -i
Sleep 2
${PY2} ${Project}/__init__.py -v
Sleep 2
${PY2} ${Project}/__init__.py ws
Sleep 2
${PY2} ${Project}/__init__.py wS

0 comments on commit 12c28f3

Please sign in to comment.