MCPcopy
hub / github.com/corpnewt/gibMacOS / head

Method head

Scripts/utils.py:231–251  ·  view source on GitHub ↗
(self, text = None, width = 55)

Source from the content-addressed store, hash-verified

229
230 # Header drawing method
231 def head(self, text = None, width = 55):
232 if not self.interactive:
233 sys.stderr.write(str(text)+"\n")
234 sys.stderr.flush()
235 return
236 if text is None:
237 text = self.name
238 self.cls()
239 print(" {}".format("#"*width))
240 mid_len = int(round(width/2-len(text)/2)-2)
241 middle = " #{}{}{}#".format(" "*mid_len, text, " "*((width - mid_len - len(text))-2))
242 if len(middle) > width+1:
243 # Get the difference
244 di = len(middle) - width
245 # Add the padding for the ...#
246 di += 3
247 # Trim the string
248 middle = middle[:-di] + "...#"
249 print(middle)
250 print("#"*width)
251 print("")
252
253 def info(self, text):
254 if self.interactive:

Callers 15

custom_quitMethod · 0.95
verify_osMethod · 0.80
diskpart_flagMethod · 0.80
diskpart_eraseMethod · 0.80
select_packageMethod · 0.80
dd_imageMethod · 0.80
install_ocMethod · 0.80
install_cloverMethod · 0.80
mainMethod · 0.80
__init__Method · 0.80
mainMethod · 0.80
set_prodsMethod · 0.80

Calls 2

clsMethod · 0.95
writeMethod · 0.80

Tested by

no test coverage detected