Skip to content

Commit

Permalink
TOML usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Ircama committed Oct 22, 2024
1 parent 6bab3a0 commit 9bc564a
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,15 @@ python3 parse_devices.py -a 192.168.178.29 -s XP-205 -p epson_print_conf.pickle
pyinstaller epson_print_conf.spec
```

Same procedure using the Reinkpy's *epson.toml* file (in place of *devices.xml*):

```bash
pip install pyinstaller # if not yet installed
curl -o epson.toml https://codeberg.org/atufi/reinkpy/raw/branch/main/reinkpy/epson.toml
python3 parse_devices.py -Ta 192.168.178.29 -s XP-205 -p epson_print_conf.pickle # use your default IP address and printer model as default settings for the GUI
pyinstaller epson_print_conf.spec
```

When embedding *epson_print_conf.pickle*, the created program does not have options and starts with the default IP address and printer model defined in the build phase.

As mentioned in the [documentation](https://pyinstaller.org/en/stable/), PyInstaller supports Windows, MacOS X, Linux and other UNIX Operating Systems. It creates an executable file which is only compatible with the operating system that is used to build the asset.
Expand All @@ -255,13 +264,20 @@ Within a [report](https://codeberg.org/atufi/reinkpy/issues/12#issue-716809) in

The program *parse_devices.py* transforms this XML DB into the dictionary that *epson_print_conf.py* can use. It is also able to accept the [TOML](https://toml.io/) input format used by [reinkpy](https://codeberg.org/atufi/reinkpy) in [epson.toml](https://codeberg.org/atufi/reinkpy/src/branch/main/reinkpy/epson.toml), if the `-T` option is used.

Here is a simple procedure to download that DB and run *parse_devices.py* to search for the XP-205 model and produce the related PRINTER_CONFIG dictionary to the standard output:
Here is a simple procedure to download the *devices.xml* DB and run *parse_devices.py* to search for the XP-205 model and produce the related PRINTER_CONFIG dictionary to the standard output:

```bash
curl -o devices.xml https://codeberg.org/attachments/147f41a3-a6ea-45f6-8c2a-25bac4495a1d
python3 parse_devices.py -i -m XP-205
```

Same procedure, processing the *epson.toml* file:

```bash
curl -o epson.toml https://codeberg.org/atufi/reinkpy/raw/branch/main/reinkpy/epson.toml
python3 parse_devices.py -T -i -m XP-205
```

After generating the related printer configuration, *epson_print_conf.py* shall be manually edited to copy/paste the output of *parse_devices.py* within its PRINTER_CONFIG dictionary. Alternatively, the program is able to create a *pickle* configuration file (check the `-p` lowercase option), which the other programs can load (with the `-P` uppercase option and in addition with the optional `-O` flag).

The `-m` option is optional and is used to filter the printer model in scope. If the produced output is not referred to the target model, use part of the model name as a filter (e.g., only the digits, like `parse_devices.py -i -m 315`) and select the appropriate model from the output.
Expand Down Expand Up @@ -320,6 +336,14 @@ python3 parse_devices.py -m ET-4800 -p epson_print_conf.pickle
python3 ui.py -P epson_print_conf.pickle
```

or (operating *epson.toml*):

```bash
curl -o epson.toml https://codeberg.org/atufi/reinkpy/raw/branch/main/reinkpy/epson.toml
python3 parse_devices.py -T -m ET-4800 -p epson_print_conf.pickle
python3 ui.py -P epson_print_conf.pickle
```

If you also want to create an executable program:

```bash
Expand Down

0 comments on commit 9bc564a

Please sign in to comment.