Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: forlayer block that applies a set of command on each layer #392

Closed
abey79 opened this issue Feb 3, 2022 · 0 comments · Fixed by #397
Closed

Feature: forlayer block that applies a set of command on each layer #392

abey79 opened this issue Feb 3, 2022 · 0 comments · Fixed by #397

Comments

@abey79
Copy link
Owner

abey79 commented Feb 3, 2022

Example:

vpype read multilayer.svg begin forlayer write "output$lid$.svg" end

Requires expression substitution to be useful. Would fix #381.

abey79 added a commit that referenced this issue Feb 21, 2022
This PR introduces expression substitution on most user input. Expressions are marked with `%` characters and are a subset of the Python language. They are interpreted using the `asteval` package (see [doc](https://newville.github.io/asteval/)). See doc for the built-in symbols.

New commands:
- `forfile`
- `forlayer`
- `eval`

Misc other changes:
- The `read` command now will not fail if the provided file doesn't exist and the `--no-fail` parameter is used
- `grid` now sets page size
- `read` now sets/update the `vp_source`/`vp_sources` system props
- added `--no-fail` to read
- added explicit support for `vp_sources` update in `vp.Document`
- Fixed pycharm type error with CliRunner.execute()
- Added reference SVG tests
- Major doc update
- Minor update to docstrings
- pined shapely to 1.8.0 due to installer breaking with the current 1.8.1 (missing geos lib)
- Updated deps

Fixes #392
Fixes #381
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant