Changeset View
Changeset View
Standalone View
Standalone View
scap/plugins/say.py
Show First 20 Lines • Show All 96 Lines • ▼ Show 20 Lines | def scap_say(words=None, eyes=None, width=None, nowrap=False, color=True): | ||||
lines = [' {:-^{width}}\n/{:^{width}}\\'.format('', '', width=box_width)] | lines = [' {:-^{width}}\n/{:^{width}}\\'.format('', '', width=box_width)] | ||||
if nowrap: | if nowrap: | ||||
lines += [ | lines += [ | ||||
'|{:<{width}}|'.format(word, width=box_width) for word in words] | '|{:<{width}}|'.format(word, width=box_width) for word in words] | ||||
else: | else: | ||||
lines += [ | lines += [ | ||||
'|{:^{width}}|'.format(word, width=box_width) for word in words] | '|{:^{width}}|'.format(word, width=box_width) for word in words] | ||||
lines.append('\{:^{width}}/\n {:-^{width}}'.format('', '', | lines.append(r'\{:^{width}}/\n {:-^{width}}'.format('', '', | ||||
width=box_width)) | width=box_width)) | ||||
lines.append('{:^10}'.format('\\')) | lines.append('{:^10}'.format('\\')) | ||||
lines.append('{:^11}'.format('\\')) | lines.append('{:^11}'.format('\\')) | ||||
lines.append('{:^13}'.format('\\')) | lines.append('{:^13}'.format('\\')) | ||||
lines.append(ansi.logo(eyes=eyes, color=color)) | lines.append(ansi.logo(eyes=eyes, color=color)) | ||||
return '\n'.join(lines) | return '\n'.join(lines) | ||||
@cli.command('fortune', help=argparse.SUPPRESS) | @cli.command('fortune', help=argparse.SUPPRESS) | ||||
Show All 38 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 3.0 (CC-BY-SA) unless otherwise noted; code licensed under GNU General Public License (GPL) or other open source licenses. By using this site, you agree to the Terms of Use, Privacy Policy, and Code of Conduct. · Wikimedia Foundation · Privacy Policy · Code of Conduct · Terms of Use · Disclaimer · CC-BY-SA · GPL