bumpversion.visualize
Visualize the bumpversion process.
BOX_CHARS
python
BOX_CHARS = {'ascii': ['+', '+', '+', '+', '+', '+', '+', '+', '-', '|', '+'], 'light': ['╯', '╮', '╭', '╰', '┤', '┴', '┬', '├', '─', '│', '┼']}Border
python
class Border(corner_bottom_right: str, corner_top_right: str, corner_top_left: str, corner_bottom_left: str, divider_left: str, divider_up: str, divider_down: str, divider_right: str, line: str, pipe: str, cross: str)A border definition.
lead_string
python
def lead_string(version_str: str, border: Border, blank: bool = False) -> strReturn the first part of a string with the bump character or spaces of the correct amount.
Examples
python
>>> lead_string("1.0.0", Border(*BOX_CHARS["light"]))
'1.0.0 ── bump ─'
>>> lead_string("1.0.0", Border(*BOX_CHARS["light"]), blank=True)
' 'Parameters
version_str: The string to render as the starting pointborder: The border definition to draw the linesblank: IfTrue, return a blank string the same length as the version bump string
Returns
- The version bump string or a blank string
connection_str
python
def connection_str(border: Border, has_next: bool = False, has_previous: bool = False) -> strReturn the correct connection string based on the next and previous.
Parameters
border: The border definition to draw the lineshas_next: IfTrue, there is a next linehas_previous: IfTrue, there is a previous line
Returns
- A string that connects left-to-right and top-to-bottom based on the next and previous
labeled_line
python
def labeled_line(label: str, border: Border, fit_length: Optional[int] = None) -> strReturn the version part string with the correct padding.
Parameters
label: The label to renderborder: The border definition to draw the linesfit_length: The length to fit the label to
Returns
- A labeled line with leading and trailing spaces
filter_version_parts
python
def filter_version_parts(config: Config) -> List[str]Return the version parts that are in the configuration.
Parameters
config: The configuration to check against
Returns
- The version parts that are in the configuration
visualize
python
def visualize(config: Config, version_str: str, box_style: str = 'light') -> NoneOutput a visualization of the bump-my-version bump process.