From 51645b1742046ec2abad0ff856045693ce538a2c Mon Sep 17 00:00:00 2001 From: jaseg Date: Sat, 6 Apr 2013 16:41:52 +0200 Subject: Unpxielterm: add support for lengthless speech bubbles --- unpixelterm.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/unpixelterm.py b/unpixelterm.py index d08e824..7c46f1c 100755 --- a/unpixelterm.py +++ b/unpixelterm.py @@ -67,7 +67,7 @@ def unpixelterm(text): img.putpixel((x, y+1), (0, 0, 255, 127)) x += 1 else: #(should be a) balloon - bw = int(re.match(r'\$balloon([0-9]*)\$', specialstr).group(1)) + bw = int(re.match(r'\$balloon([0-9]*)\$', specialstr).group(1) or '1') for i in range(x, x+bw): img.putpixel((i, y), (0, 255, 0, 127)) img.putpixel((i, y+1), (0, 255, 0, 127)) @@ -98,6 +98,7 @@ if __name__ == '__main__': sys.exit(1) for f in args.input: + print(f.name) img, metadata = unpixelterm(f.read()) if args.verbose: print('Metadata:') -- cgit