aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjaseg <s@jaseg.de>2013-04-06 16:41:52 +0200
committerjaseg <s@jaseg.de>2013-04-06 16:41:52 +0200
commit51645b1742046ec2abad0ff856045693ce538a2c (patch)
tree79837bba5bb1ea928e6aedf4be21787101f7d569
parent658c18576084b7cb35724291f9b531046ff57603 (diff)
downloadpixelterm-51645b1742046ec2abad0ff856045693ce538a2c.tar.gz
pixelterm-51645b1742046ec2abad0ff856045693ce538a2c.tar.bz2
pixelterm-51645b1742046ec2abad0ff856045693ce538a2c.zip
Unpxielterm: add support for lengthless speech bubbles
-rwxr-xr-xunpixelterm.py3
1 files changed, 2 insertions, 1 deletions
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:')