mirror of
https://github.com/esphome/esphome.git
synced 2024-12-11 14:49:20 +01:00
Add check if middle_text is too short (#811)
* Add check if middle_text is too short * Use int division as suggested
This commit is contained in:
parent
82a30558e1
commit
f22115792a
@ -364,7 +364,7 @@ def command_update_all(args):
|
|||||||
def print_bar(middle_text):
|
def print_bar(middle_text):
|
||||||
middle_text = " {} ".format(middle_text)
|
middle_text = " {} ".format(middle_text)
|
||||||
width = len(click.unstyle(middle_text))
|
width = len(click.unstyle(middle_text))
|
||||||
half_line = "=" * ((twidth - width) / 2)
|
half_line = "=" * ((twidth - width) // 2)
|
||||||
click.echo("%s%s%s" % (half_line, middle_text, half_line))
|
click.echo("%s%s%s" % (half_line, middle_text, half_line))
|
||||||
|
|
||||||
for f in files:
|
for f in files:
|
||||||
|
Loading…
Reference in New Issue
Block a user