diff options
author | jaseg <s@jaseg.de> | 2013-09-16 16:37:15 +0200 |
---|---|---|
committer | jaseg <s@jaseg.de> | 2013-09-16 16:37:15 +0200 |
commit | 26bf093af79166b502724c2ca4f8fa5924205ec2 (patch) | |
tree | e2c983ad00ce390cc00ca14ade87c8e5050b6f1e /termcenter | |
parent | ea24fc5026cc85ba363c9a6496789a018498ece4 (diff) | |
download | ponysay-26bf093af79166b502724c2ca4f8fa5924205ec2.tar.gz ponysay-26bf093af79166b502724c2ca4f8fa5924205ec2.tar.bz2 ponysay-26bf093af79166b502724c2ca4f8fa5924205ec2.zip |
Fixed setup stuff. Python setuptools really is a pain.
Diffstat (limited to 'termcenter')
-rwxr-xr-x | termcenter | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/termcenter b/termcenter deleted file mode 100755 index 54fffa0..0000000 --- a/termcenter +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python3 - -import os,sys,time, itertools -import argparse -from subprocess import * -try: - import re2 as re -except: - import re - -parser = argparse.ArgumentParser(description='Center stuff on terminals') -parser.add_argument('string', nargs='*', type=str) -args = parser.parse_args() - -for e in [sys.stdin] + args.string: - lines = [e] if isinstance(e, str) else e.readlines() - if lines: - width = max(map(len, map(lambda s: re.sub(r'\x1B\[[0-9;]+m|\$.*\$', '', s), lines))) - pad = int((os.get_terminal_size()[0]- width)/2) - for line in lines: - print(' '*pad + re.sub(r'\$.*\$|\n', '', line)) - |