-
-
Notifications
You must be signed in to change notification settings - Fork 64
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: property substitution and block overhaul #395
Conversation
The input provided to most commands' arguments and options may now contain substitution patterns which will be replaced by the corresponding property value. This created the need for deferred evaluation of click-provided arguments and options. The type classes now return subclass of `_DeferredEvaluator` which are detected by the command decorators (`@generator`, etc.) and replaced by their evaluated value before they reach the command function. In turn, implementing the above lead to the overhaul of the block processor sub-system. Block processors are now implemented as functions and the nested command have access to the current layer structure. * Added property substitution function to `vpype_cli.State` * Added mechanism to perform deferred evaluation of Click argument/option value * Added `TextType` class to use as Click type instead of `str` so property substitution is performed. * Updated types to perform property substitution * `grid` now iterates along lines first * Document.clone() now has an option to keep the layer structure/metadata (without line data) * fixed an issue where metadata dict could be shared across Doc/LC, leading to potential bugs. * fixed a bug with `random` when using non-square area * Various docstring fixes and improvements * `assert_image_similarity` now skips the test when the reference image is saved
Fixed doc heading level
Codecov Report
@@ Coverage Diff @@
## master #395 +/- ##
==========================================
+ Coverage 92.89% 93.54% +0.65%
==========================================
Files 55 56 +1
Lines 4587 4663 +76
Branches 639 648 +9
==========================================
+ Hits 4261 4362 +101
+ Misses 217 201 -16
+ Partials 109 100 -9
Continue to review full report at Codecov.
|
- Added default target layer change to CHANGELOG.md Fixes #393
- Fixed dead code in conf.py Thanks SonarCloud!
Thanks SonarCloud!
- fixed missing TextType in propset, propget, propdel and pens - fixed argument type to AngleType for skew
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Description
The input provided to most commands' arguments and options may now contain substitution patterns which will be replaced by the corresponding property value.
This created the need for deferred evaluation of click-provided arguments and options. The type classes now return subclass of
_DeferredEvaluator
which are detected by the command decorators (@generator
, etc.) and replaced by their evaluated value before they reach the command function.In turn, implementing the above lead to the overhaul of the block processor sub-system. Block processors are now implemented as functions and the nested command have access to the current layer structure. Also,
begin
is now optional.Also:
vpype_cli.State
TextType
andIntegerType
classes to use as Click type instead ofstr
, responding.int
to perform property substitutionnew
)grid
now iterates along lines firstrandom
when using non-square areaassert_image_similarity
now skips the test when the reference image is savedFixes #393
Minor bug addressed in #396
Checklist
black
andisort
)mypy
returns no errorpytest
succeedshelp
reference.rst
make clean && make html
indocs/
)