LilyBlocks are a 2D representation of strings that behave somewhat similarly to LilyStrings but with some reduced function. They can be created from the standard grow entrypoint. Some key features:
normalize(): Adjust block so that all rows are the same width, with justification. Helpful for background colors.
resize(): A 2D version of LilyString's resize. Fairly awesome.
concat(): A way to add a LilyString to the right of another one. Adding squash=True will just merge the strings, but the default behavior first normalizes the block with a left justification.
append(): Add more rows to your LilyBlock.
Project improvements!
The main module entrypoint now provides some convenient test execution methods from the command line.
Support for grep and substring test filtering
Lots of unit tests, although coverage is still pretty meh
Remove some antiquated base class stuff and rework into a LilyBase class
Improvements to grow and wilt to their own location, and some augmentation for LilyBlock functionality
Some basic project restructuring/refactors
LilyString improvements/fixes!
More natural command-line reversed() support
Now functions with the in keyword with both LilyStrings (color sensitive) and Python strings (color insensitive)
Lots of small cleanup stuff
Fixes to join()
Things that should still be done in another PR:
Allow LilyBlock as a parameter to append()
Allow justification when using concat() and append()
Row-based coloration: Pattern or predicate matching to color the whole row.
12
Introducing
LilyBlocks
!LilyBlocks are a 2D representation of strings that behave somewhat similarly to LilyStrings but with some reduced function. They can be created from the standard
grow
entrypoint. Some key features:normalize()
: Adjust block so that all rows are the same width, with justification. Helpful for background colors.resize()
: A 2D version of LilyString'sresize
. Fairly awesome.concat()
: A way to add a LilyString to the right of another one. Addingsquash=True
will just merge the strings, but the default behavior first normalizes the block with a left justification.append()
: Add more rows to your LilyBlock.Project improvements!
LilyBase
classgrow
andwilt
to their own location, and some augmentation forLilyBlock
functionalityLilyString improvements/fixes!
reversed()
supportin
keyword with bothLilyString
s (color sensitive) and Python strings (color insensitive)join()
Things that should still be done in another PR:
append()
concat()
andappend()