mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 11:21:25 -07:00
Python 2.6 str.format()
compatibility fixes.
This commit is contained in:
parent
95ff8f1a90
commit
797664d9cb
20 changed files with 43 additions and 62 deletions
|
@ -71,7 +71,7 @@ def colorize(msg, color):
|
|||
if DONT_COLORIZE:
|
||||
return msg
|
||||
else:
|
||||
return '{}{}{}'.format(COLORS[color], msg, COLORS['endc'])
|
||||
return '{0}{1}{2}'.format(COLORS[color], msg, COLORS['endc'])
|
||||
|
||||
|
||||
class CallbackModule(CallbackBase):
|
||||
|
@ -104,15 +104,15 @@ class CallbackModule(CallbackBase):
|
|||
line_length = 120
|
||||
if self.last_skipped:
|
||||
print()
|
||||
msg = colorize("# {} {}".format(task_name,
|
||||
'*' * (line_length - len(task_name))), 'bold')
|
||||
msg = colorize("# {0} {1}".format(task_name,
|
||||
'*' * (line_length - len(task_name))), 'bold')
|
||||
print(msg)
|
||||
|
||||
def _indent_text(self, text, indent_level):
|
||||
lines = text.splitlines()
|
||||
result_lines = []
|
||||
for l in lines:
|
||||
result_lines.append("{}{}".format(' ' * indent_level, l))
|
||||
result_lines.append("{0}{1}".format(' ' * indent_level, l))
|
||||
return '\n'.join(result_lines)
|
||||
|
||||
def _print_diff(self, diff, indent_level):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue