ibm5250 0.1.0.dev0__tar.gz → 0.1.0.dev1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -53,7 +53,7 @@ interact.
53
53
  row*cols+col — always use `encode_addr`/`decode_addr`/`rowcol_to_pos`/
54
54
  `pos_to_rowcol` rather than hand-rolling the math).
55
55
  6. **`exceptions.py`** — all custom exceptions derive from `IBM5250Error`.
56
- Note `RecvTimeout` is *not* fatal (socket alive, server just idle) — it's
56
+ Note `RecvTimeout` is _not_ fatal (socket alive, server just idle) — it's
57
57
  distinct from `ConnectionError`.
58
58
 
59
59
  Key stateful quirk: after a server-initiated **SAVE_SCREEN**/**RESTORE_SCREEN**
@@ -7,11 +7,11 @@ tokens or secrets are stored in this repository.
7
7
 
8
8
  ## Branch behavior
9
9
 
10
- | Branch | Test | Build | Publish | Version format |
11
- |------------------------|:----:|:-----:|:-------:|--------------------------|
12
- | `main` | ✅ | ✅ | ✅ (real PyPI, production) | `X.Y.Z` (patch auto-incremented from the latest published release for that `X.Y`) |
13
- | `develop` | ✅ | ✅ | ✅ (real PyPI, development) | `X.Y.Z.devN` (`N` auto-incremented per base version) |
14
- | any other branch | ✅ | ✅ | ❌ | n/a (build artifact only, not published) |
10
+ | Branch | Test | Build | Publish | Version format |
11
+ | ---------------- | :--: | :---: | :-------------------------: | --------------------------------------------------------------------------------- |
12
+ | `main` | ✅ | ✅ | ✅ (real PyPI, production) | `X.Y.Z` (patch auto-incremented from the latest published release for that `X.Y`) |
13
+ | `develop` | ✅ | ✅ | ✅ (real PyPI, development) | `X.Y.Z.devN` (`N` auto-incremented per base version) |
14
+ | any other branch | ✅ | ✅ | ❌ | n/a (build artifact only, not published) |
15
15
 
16
16
  The base version (`project.version` in `pyproject.toml`) is **never modified in
17
17
  the repository**. `scripts/compute_version.py` queries PyPI's public JSON API
@@ -19,6 +19,15 @@ the repository**. `scripts/compute_version.py` queries PyPI's public JSON API
19
19
  version number, and `uv version` applies it only to the ephemeral CI checkout
20
20
  before `uv build` runs.
21
21
 
22
+ ## Formatting
23
+
24
+ A separate `format` job runs [Prettier](https://prettier.io/) (via
25
+ `npx prettier --check .`) against the repo — predominantly YAML and Markdown
26
+ files — to keep formatting consistent, using Prettier's default rules (no
27
+ project-level config). `build` depends on both `test` and `format` passing.
28
+ Run `npx prettier --write .` locally to auto-fix formatting issues before
29
+ pushing.
30
+
22
31
  ## One-time setup required on PyPI
23
32
 
24
33
  Trusted Publishing must be configured on the `ibm5250` project at
@@ -28,9 +28,24 @@ jobs:
28
28
  - name: Run tests
29
29
  run: uv run pytest
30
30
 
31
+ format:
32
+ name: Format (Prettier)
33
+ runs-on: ubuntu-latest
34
+ steps:
35
+ - name: Checkout
36
+ uses: actions/checkout@v4
37
+
38
+ - name: Setup Node.js
39
+ uses: actions/setup-node@v4
40
+ with:
41
+ node-version: 20
42
+
43
+ - name: Check formatting with Prettier
44
+ run: npx --yes prettier --check .
45
+
31
46
  build:
32
47
  name: Build
33
- needs: test
48
+ needs: [test, format]
34
49
  runs-on: ubuntu-latest
35
50
  outputs:
36
51
  version: ${{ steps.version.outputs.version }}
@@ -18,3 +18,7 @@ venv/
18
18
 
19
19
  # Python Caches
20
20
  .pytest_cache/
21
+ .ruff_cache/
22
+
23
+ # Node.js (Prettier tooling)
24
+ node_modules/
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ibm5250
3
- Version: 0.1.0.dev0
3
+ Version: 0.1.0.dev1
4
4
  Summary: IBM 5250 terminal automation library
5
5
  License-File: LICENSE
6
6
  Requires-Python: >=3.11
@@ -59,11 +59,11 @@ sure `ruff check` and `pytest` both pass.
59
59
  Every push runs the test suite in CI. What gets built and published to PyPI
60
60
  depends on the branch:
61
61
 
62
- | Branch | Tested | Built | Published to PyPI | Version format |
63
- |--------------------|:------:|:-----:|:------------------:|-----------------|
64
- | `main` | ✅ | ✅ | ✅ production | `X.Y.Z` (patch auto-incremented from the latest release) |
65
- | `develop` | ✅ | ✅ | ✅ development | `X.Y.Z.devN` |
66
- | any other branch | ✅ | ✅ | ❌ (build artifact only) | n/a |
62
+ | Branch | Tested | Built | Published to PyPI | Version format |
63
+ | ---------------- | :----: | :---: | :----------------------: | -------------------------------------------------------- |
64
+ | `main` | ✅ | ✅ | ✅ production | `X.Y.Z` (patch auto-incremented from the latest release) |
65
+ | `develop` | ✅ | ✅ | ✅ development | `X.Y.Z.devN` |
66
+ | any other branch | ✅ | ✅ | ❌ (build artifact only) | n/a |
67
67
 
68
68
  - Contribute by branching off `develop` and opening PRs into `develop`.
69
69
  `develop` publishes `.devN` releases so changes can be tried out before
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "ibm5250"
3
- version = "0.1.0.dev0"
3
+ version = "0.1.0.dev1"
4
4
  description = "IBM 5250 terminal automation library"
5
5
  requires-python = ">=3.11"
6
6
 
@@ -44,16 +44,16 @@ The **DataStreamParser** takes a raw 5250 payload (one record from the connectio
44
44
 
45
45
  Every 5250 record starts with a **command byte**:
46
46
 
47
- | Command | Meaning |
48
- |---------|---------|
49
- | `0x11` (Write to Display) | Main screen update — followed by CC1, CC2, then orders/data |
50
- | `0x02` (Save Screen) | Server wants to save the current screen (same format as WTD) |
51
- | `0x12` (Restore Screen) | Server wants to restore a previously saved screen |
52
- | `0x04` (ESC) | Escape prefix — next byte is the real command (WTD, WSF, Save, Restore) |
53
- | `0xF3` (Write Structured Field) | Carries structured data like Query commands |
54
- | `0x42/0x52/0x72/0x62` | Read commands — server asks client to send back screen/field data |
55
- | `0x21` (Write Error Code) | Display error on status line |
56
- | `0x50` (Clear Format Table) | Discard field definitions |
47
+ | Command | Meaning |
48
+ | ------------------------------- | ----------------------------------------------------------------------- |
49
+ | `0x11` (Write to Display) | Main screen update — followed by CC1, CC2, then orders/data |
50
+ | `0x02` (Save Screen) | Server wants to save the current screen (same format as WTD) |
51
+ | `0x12` (Restore Screen) | Server wants to restore a previously saved screen |
52
+ | `0x04` (ESC) | Escape prefix — next byte is the real command (WTD, WSF, Save, Restore) |
53
+ | `0xF3` (Write Structured Field) | Carries structured data like Query commands |
54
+ | `0x42/0x52/0x72/0x62` | Read commands — server asks client to send back screen/field data |
55
+ | `0x21` (Write Error Code) | Display error on status line |
56
+ | `0x50` (Clear Format Table) | Discard field definitions |
57
57
 
58
58
  ### Control Characters (CC1 / CC2)
59
59
 
@@ -73,18 +73,18 @@ After a WTD or Save Screen command, two bytes control screen-level behavior:
73
73
 
74
74
  After the command + CC bytes, the rest of the record is a stream of **orders** intermixed with **data bytes**:
75
75
 
76
- | Order | What it does |
77
- |-------|-------------|
78
- | **SBA** — Set Buffer Address (`0x11`) + row + col | Move the write position to a specific screen cell |
79
- | **SF** — Start Field (`0x1D`) + FFW [+ FCWs] | Define a new input/output field at the current position. The FFW (Field Format Word, 2 bytes) defines field type — bypass/input, numeric, non-display, etc. Optional FCW (Field Control Word) pairs add behaviours like mandatory entry, right-adjust, or monocase. |
80
- | **MF** — Modify Field (`0x2C`) + FFW [+ FCWs] | Modify an existing field's attributes |
81
- | **IC** — Insert Cursor (`0x13`) | Place the cursor at the current position |
82
- | **MC** — Move Cursor (`0x14`) + row + col | Move the cursor to a specific position |
83
- | **RA** — Repeat to Address (`0x3C`) + row + col + char | Repeat a character from current position up to the target |
84
- | **EA** — Erase to Address (`0x12`) + row + col | Erase (fill with nulls) from current position to target |
85
- | **TD** — Transparent Data (`0x10`) + length + data | Write raw bytes (transparent, no order interpretation) |
86
- | **SA** — Set Attribute (`0x28`) + type + value | Set a display attribute (colour, underline, etc.) |
87
- | **SOH** — Start of Header (`0x01`) + length + data | Metadata block, skipped |
76
+ | Order | What it does |
77
+ | ------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
78
+ | **SBA** — Set Buffer Address (`0x11`) + row + col | Move the write position to a specific screen cell |
79
+ | **SF** — Start Field (`0x1D`) + FFW [+ FCWs] | Define a new input/output field at the current position. The FFW (Field Format Word, 2 bytes) defines field type — bypass/input, numeric, non-display, etc. Optional FCW (Field Control Word) pairs add behaviours like mandatory entry, right-adjust, or monocase. |
80
+ | **MF** — Modify Field (`0x2C`) + FFW [+ FCWs] | Modify an existing field's attributes |
81
+ | **IC** — Insert Cursor (`0x13`) | Place the cursor at the current position |
82
+ | **MC** — Move Cursor (`0x14`) + row + col | Move the cursor to a specific position |
83
+ | **RA** — Repeat to Address (`0x3C`) + row + col + char | Repeat a character from current position up to the target |
84
+ | **EA** — Erase to Address (`0x12`) + row + col | Erase (fill with nulls) from current position to target |
85
+ | **TD** — Transparent Data (`0x10`) + length + data | Write raw bytes (transparent, no order interpretation) |
86
+ | **SA** — Set Attribute (`0x28`) + type + value | Set a display attribute (colour, underline, etc.) |
87
+ | **SOH** — Start of Header (`0x01`) + length + data | Metadata block, skipped |
88
88
 
89
89
  Anything that isn't a recognized order byte is treated as **EBCDIC (Extended Binary Coded Decimal Interchange Code)** character data and written sequentially into the screen buffer.
90
90
 
@@ -99,6 +99,7 @@ When the server sends a WSF Query command, the parser emits a **QUERY** event. T
99
99
  ### Events Produced
100
100
 
101
101
  Each order/data run becomes a `DSEvent` with a type like:
102
+
102
103
  - `CLEAR_SCREEN` — wipe the buffer
103
104
  - `RESIZE_SCREEN` — change dimensions
104
105
  - `SET_POS` — move write cursor
@@ -13,7 +13,7 @@ wheels = [
13
13
 
14
14
  [[package]]
15
15
  name = "ibm5250"
16
- version = "0.1.0.dev0"
16
+ version = "0.1.0.dev1"
17
17
  source = { editable = "." }
18
18
 
19
19
  [package.dev-dependencies]
File without changes