mrz1988 / lilies

A cross-platform colored text formatting tool for the command line
MIT License
0 stars 0 forks source link

Improve append() to accept more input and justify settings #35

Closed mrz1988 closed 5 years ago

mrz1988 commented 5 years ago

This PR has a few improvements that I made to project structure, as well as significant improvements to the append() function of LilyBlocks. Previously, LilyBlocks would only accept strings or LilyStrings as appendable input, and wouldn't accept blocks. Append now:

  1. Accepts LilyBlock, LilyString, python strings, and more as input (will string cast for the most part)
  2. Will justify the smaller of the two blocks to the larger one if desired. If justify='right' is used, for instance, the smaller block will be completely resized, and justified to the right side of the larger block.
  3. By default, justification is 'left', and append will not normalize either block.
  4. The smaller block will be normalized if justification is 'left', but the larger block will not.
codecov-io commented 5 years ago

Codecov Report

Merging #35 into master will increase coverage by 1.27%. The diff coverage is 77.08%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #35      +/-   ##
==========================================
+ Coverage   67.92%   69.19%   +1.27%     
==========================================
  Files          10       11       +1     
  Lines         848      857       +9     
  Branches      136      136              
==========================================
+ Hits          576      593      +17     
+ Misses        251      244       -7     
+ Partials       21       20       -1
Impacted Files Coverage Δ
lilies/manage.py 100% <ø> (ø)
lilies/grow.py 75% <ø> (ø)
lilies/lilyblock.py 79.5% <100%> (+3.47%) :arrow_up:
lilies/cli_utils.py 17.77% <100%> (ø)
lilies/lilystring.py 80.78% <22.22%> (+0.98%) :arrow_up:
lilies/base_utils.py 78.94% <78.94%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 73903b8...7ae4bed. Read the comment docs.