Skip to content

Commit b39c35c

Browse files
0.0.1
1 parent b2b9533 commit b39c35c

9 files changed

Lines changed: 140 additions & 7 deletions

File tree

‎.github/workflows/python-package.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
python -m pip install build
6767
python -m build
6868
python -m pip install dist/woad-*.whl
69-
python -c "import woad; assert woad.__version__ == '0.0.0'; print(woad.__version__)"
69+
python -c "import woad; assert woad.__version__ == '0.0.1'; print(woad.__version__)"
7070
7171
build-py27:
7272

‎CHANGES.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# woad.Python - Changes <!-- omit in toc -->
22

33

4+
## 0.0.1 - 15th August 2026
5+
6+
* SGR colour and reset codes (`RESET`, `FG_*`, `BG_*`, including bright variants);
7+
8+
49
## 0.0.0 - 15th August 2026
510

611
* initial project scaffolding;

‎NEWS.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# woad.Python - News <!-- omit in toc -->
2+
3+
| Date | News Item |
4+
| ---------------- | ------------------------------------------------------------------------------------------ |
5+
| 15th August 2026 | [**woad.Python** 0.0.1](https://github.com/synesissoftware/woad.Python/releases/tag/0.0.1) |
6+
| 15th August 2026 | [**woad.Python** 0.0.0](https://github.com/synesissoftware/woad.Python/releases/tag/0.0.0) |
7+
8+
9+
<!-- ########################### end of file ########################### -->

‎README.md‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,14 @@ Use via **import**:
4646

4747
```Python
4848
import woad
49+
50+
print(woad.FG_GREEN + "ok" + woad.RESET)
4951
```
5052

5153

5254
## Components
5355

54-
**woad.Python** currently ships the **`woad`** package and version metadata (`woad.__version__`). Colour codes, TTY/stream gating, and Windows virtual-terminal opt-in are not implemented in this 0.0.0 skeleton.
56+
**woad.Python** ships SGR string constants (`RESET`, `FG_*`, `BG_*`, including bright variants). TTY/stream gating and Windows virtual-terminal opt-in are not implemented yet.
5557

5658

5759
## Project Information
@@ -87,6 +89,7 @@ None (currently).
8789

8890
### Related projects
8991

92+
* [**woad**](https://github.com/synesissoftware/woad/)
9093
* [**woad.Ruby**](https://github.com/synesissoftware/woad.Ruby/)
9194
* [**woad.Rust**](https://github.com/synesissoftware/woad.Rust/)
9295

‎TODO.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
## Functional improvements
55

6-
* [ ] SGR colour and reset codes;
6+
* [x] ~~~SGR colour and reset codes~~~ ✅;
77
* [ ] TTY-conditional colour codes (process and per-stream);
88
* [ ] Windows virtual-terminal gating (OS build + `GetConsoleMode`);
99

‎pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ license = { text = "BSD-3-Clause" }
4242
name = "woad"
4343
readme = "README.md"
4444
requires-python = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, !=3.6.*, !=3.7.*"
45-
version = "0.0.0"
45+
version = "0.0.1"
4646

4747
[project.urls]
4848
"Bug Tracker" = "https://github.com/synesissoftware/woad.Python/issues"

‎setup.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
name='woad',
77
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, !=3.6.*, !=3.7.*',
8-
version='0.0.0',
8+
version='0.0.1',
99

1010
author='Matt Wilson',
1111
author_email='matthew@synesis.com.au',

‎tests/test_woad.py‎

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,31 @@ class Test_woad(unittest.TestCase):
77

88
def test_version(self):
99

10-
self.assertEqual('0.0.0', woad.__version__)
10+
self.assertEqual('0.0.1', woad.__version__)
11+
12+
def test_RESET(self):
13+
14+
self.assertEqual('\033[0m', woad.RESET)
15+
16+
def test_FG_RED(self):
17+
18+
self.assertEqual('\033[31m', woad.FG_RED)
19+
20+
def test_BG_BLUE(self):
21+
22+
self.assertEqual('\033[44m', woad.BG_BLUE)
23+
24+
def test_all_codes_are_csi_sgr(self):
25+
26+
for name in woad.__all__:
27+
28+
code = getattr(woad, name)
29+
30+
self.assertTrue(
31+
code.startswith('\033['),
32+
name,
33+
)
34+
self.assertTrue(
35+
code.endswith('m'),
36+
name,
37+
)

‎woad/__init__.py‎

Lines changed: 90 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,94 @@
1212
__license__ = 'BSD-3-Clause'
1313
__maintainer__ = 'Matt Wilson'
1414
__status__ = 'Alpha'
15-
__version__ = '0.0.0'
15+
__version__ = '0.0.1'
1616

17+
18+
# Reset
19+
20+
RESET = '\033[0m'
21+
22+
23+
# Foreground (standard)
24+
25+
FG_BLACK = '\033[30m'
26+
FG_RED = '\033[31m'
27+
FG_GREEN = '\033[32m'
28+
FG_YELLOW = '\033[33m'
29+
FG_BLUE = '\033[34m'
30+
FG_MAGENTA = '\033[35m'
31+
FG_CYAN = '\033[36m'
32+
FG_WHITE = '\033[37m'
33+
34+
35+
# Foreground (bright)
36+
37+
FG_BRIGHT_BLACK = '\033[90m'
38+
FG_BRIGHT_RED = '\033[91m'
39+
FG_BRIGHT_GREEN = '\033[92m'
40+
FG_BRIGHT_YELLOW = '\033[93m'
41+
FG_BRIGHT_BLUE = '\033[94m'
42+
FG_BRIGHT_MAGENTA = '\033[95m'
43+
FG_BRIGHT_CYAN = '\033[96m'
44+
FG_BRIGHT_WHITE = '\033[97m'
45+
46+
47+
# Background (standard)
48+
49+
BG_BLACK = '\033[40m'
50+
BG_RED = '\033[41m'
51+
BG_GREEN = '\033[42m'
52+
BG_YELLOW = '\033[43m'
53+
BG_BLUE = '\033[44m'
54+
BG_MAGENTA = '\033[45m'
55+
BG_CYAN = '\033[46m'
56+
BG_WHITE = '\033[47m'
57+
58+
59+
# Background (bright)
60+
61+
BG_BRIGHT_BLACK = '\033[100m'
62+
BG_BRIGHT_RED = '\033[101m'
63+
BG_BRIGHT_GREEN = '\033[102m'
64+
BG_BRIGHT_YELLOW = '\033[103m'
65+
BG_BRIGHT_BLUE = '\033[104m'
66+
BG_BRIGHT_MAGENTA = '\033[105m'
67+
BG_BRIGHT_CYAN = '\033[106m'
68+
BG_BRIGHT_WHITE = '\033[107m'
69+
70+
71+
__all__ = [
72+
'BG_BLACK',
73+
'BG_BLUE',
74+
'BG_BRIGHT_BLACK',
75+
'BG_BRIGHT_BLUE',
76+
'BG_BRIGHT_CYAN',
77+
'BG_BRIGHT_GREEN',
78+
'BG_BRIGHT_MAGENTA',
79+
'BG_BRIGHT_RED',
80+
'BG_BRIGHT_WHITE',
81+
'BG_BRIGHT_YELLOW',
82+
'BG_CYAN',
83+
'BG_GREEN',
84+
'BG_MAGENTA',
85+
'BG_RED',
86+
'BG_WHITE',
87+
'BG_YELLOW',
88+
'FG_BLACK',
89+
'FG_BLUE',
90+
'FG_BRIGHT_BLACK',
91+
'FG_BRIGHT_BLUE',
92+
'FG_BRIGHT_CYAN',
93+
'FG_BRIGHT_GREEN',
94+
'FG_BRIGHT_MAGENTA',
95+
'FG_BRIGHT_RED',
96+
'FG_BRIGHT_WHITE',
97+
'FG_BRIGHT_YELLOW',
98+
'FG_CYAN',
99+
'FG_GREEN',
100+
'FG_MAGENTA',
101+
'FG_RED',
102+
'FG_WHITE',
103+
'FG_YELLOW',
104+
'RESET',
105+
]

0 commit comments

Comments
 (0)