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.
- {ibm5250-0.1.0.dev0 → ibm5250-0.1.0.dev1}/.github/copilot-instructions.md +1 -1
- {ibm5250-0.1.0.dev0 → ibm5250-0.1.0.dev1}/.github/workflows/README.md +14 -5
- {ibm5250-0.1.0.dev0 → ibm5250-0.1.0.dev1}/.github/workflows/publish.yml +16 -1
- {ibm5250-0.1.0.dev0 → ibm5250-0.1.0.dev1}/.gitignore +4 -0
- {ibm5250-0.1.0.dev0 → ibm5250-0.1.0.dev1}/PKG-INFO +1 -1
- {ibm5250-0.1.0.dev0 → ibm5250-0.1.0.dev1}/README.md +5 -5
- {ibm5250-0.1.0.dev0 → ibm5250-0.1.0.dev1}/pyproject.toml +1 -1
- {ibm5250-0.1.0.dev0 → ibm5250-0.1.0.dev1}/src/ibm5250/data-stream-logic.md +23 -22
- {ibm5250-0.1.0.dev0 → ibm5250-0.1.0.dev1}/uv.lock +1 -1
- {ibm5250-0.1.0.dev0 → ibm5250-0.1.0.dev1}/LICENSE +0 -0
- {ibm5250-0.1.0.dev0 → ibm5250-0.1.0.dev1}/scripts/compute_version.py +0 -0
- {ibm5250-0.1.0.dev0 → ibm5250-0.1.0.dev1}/src/ibm5250/__init__.py +0 -0
- {ibm5250-0.1.0.dev0 → ibm5250-0.1.0.dev1}/src/ibm5250/connection.py +0 -0
- {ibm5250-0.1.0.dev0 → ibm5250-0.1.0.dev1}/src/ibm5250/constants.py +0 -0
- {ibm5250-0.1.0.dev0 → ibm5250-0.1.0.dev1}/src/ibm5250/datastream.py +0 -0
- {ibm5250-0.1.0.dev0 → ibm5250-0.1.0.dev1}/src/ibm5250/exceptions.py +0 -0
- {ibm5250-0.1.0.dev0 → ibm5250-0.1.0.dev1}/src/ibm5250/screen.py +0 -0
- {ibm5250-0.1.0.dev0 → ibm5250-0.1.0.dev1}/src/ibm5250/terminal.py +0 -0
|
@@ -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
|
|
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
|
|
11
|
-
|
|
12
|
-
| `main`
|
|
13
|
-
| `develop`
|
|
14
|
-
| any other branch
|
|
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 }}
|
|
@@ -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
|
|
63
|
-
|
|
64
|
-
| `main`
|
|
65
|
-
| `develop`
|
|
66
|
-
| any other branch
|
|
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
|
|
@@ -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
|
|
48
|
-
|
|
49
|
-
| `0x11` (Write to Display)
|
|
50
|
-
| `0x02` (Save Screen)
|
|
51
|
-
| `0x12` (Restore Screen)
|
|
52
|
-
| `0x04` (ESC)
|
|
53
|
-
| `0xF3` (Write Structured Field) | Carries structured data like Query commands
|
|
54
|
-
| `0x42/0x52/0x72/0x62`
|
|
55
|
-
| `0x21` (Write Error Code)
|
|
56
|
-
| `0x50` (Clear Format Table)
|
|
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
|
|
77
|
-
|
|
78
|
-
| **SBA** — Set Buffer Address (`0x11`) + row + col
|
|
79
|
-
| **SF** — Start Field (`0x1D`) + FFW [+ FCWs]
|
|
80
|
-
| **MF** — Modify Field (`0x2C`) + FFW [+ FCWs]
|
|
81
|
-
| **IC** — Insert Cursor (`0x13`)
|
|
82
|
-
| **MC** — Move Cursor (`0x14`) + row + col
|
|
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
|
|
85
|
-
| **TD** — Transparent Data (`0x10`) + length + data
|
|
86
|
-
| **SA** — Set Attribute (`0x28`) + type + value
|
|
87
|
-
| **SOH** — Start of Header (`0x01`) + length + data
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|