MCPcopy Create free account
hub / github.com/ForgeRock/forgeops / sub_title

Function sub_title

lib/python/utils.py:155–169  ·  view source on GitHub ↗
(title)

Source from the content-addressed store, hash-verified

153 print(f"{PURPLE}{s}{ENDC}")
154
155def sub_title(title):
156 total_length = 100
157 spacing_length = 3 if len(title) > 0 else 0
158 total_length -= 2 * spacing_length
159 total_length -= len(title)
160 if total_length < 0:
161 warning(f'title "{title}" is too long')
162 one_more = total_length % 2
163 separator_char = '-'
164 separator_count = int(total_length / 2)
165 first_part = separator_count * separator_char + (spacing_length + one_more) * ' '
166 second_part = spacing_length * ' ' + separator_count * separator_char
167 msg = first_part + str(title) + second_part
168 print('')
169 print(msg)
170
171def run(cmd, *cmdArgs, stdin=None, cstdout=False, cstderr=False, cwd=None, env=None, ignoreFail=False, dryrun=False):
172 """

Callers

nothing calls this directly

Calls 1

warningFunction · 0.85

Tested by

no test coverage detected