Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Write Your Python Program - CHANGELOG

* 2.2.2 (2026-04-03)
* Fixed package hiding bug
* 2.2.1 (2026-03-26)
* Functionality for running standard unit tests
* 2.2.0 (2026-03-17)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "Write Your Python Program!",
"description": "A user friendly python environment for beginners",
"license": "See license in LICENSE",
"version": "2.2.1",
"version": "2.2.2",
"publisher": "StefanWehr",
"icon": "icon.png",
"engines": {
Expand Down
18 changes: 17 additions & 1 deletion python/code/wypp/ansi.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import re
import sys
import os

RESET = "\u001b[0;0m"
BOLD = "\u001b[1m"
Expand All @@ -21,8 +23,22 @@
YELLOW = "\u001b[1;33m"
WHITE = "\u001b[1;37m"

def useColors():
if os.environ.get("WYPP_FORCE_COLORS") == "True":
return True
if "NO_COLOR" in os.environ:
return False
if not sys.stdout.isatty():
return False
if os.environ.get("TERM") == "dumb":
return False
return True

def color(s, color):
return color + s + RESET
if useColors():
return color + s + RESET
else:
return s

def green(s):
return color(s, GREEN + BOLD)
Expand Down
1 change: 1 addition & 0 deletions python/fileTestsLib.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ def _runTest(testFile: str,
env = os.environ.copy()
env['PYTHONPATH'] = os.pathsep.join([os.path.join(ctx.opts.baseDir, 'code')] + pythonPath)
env['WYPP_UNDER_TEST'] = 'True'
env['WYPP_FORCE_COLORS'] = 'True'
debug(' '.join(cmd))
with open(actualStdoutFile, 'w') as stdoutFile, \
open(actualStderrFile, 'w') as stderrFile:
Expand Down
Loading