diff options
author | jaseg <s@jaseg.de> | 2013-07-29 18:52:43 +0200 |
---|---|---|
committer | jaseg <s@jaseg.de> | 2013-07-29 19:00:49 +0200 |
commit | a1ce05f39b96f6992a8718ee4a192300f6db62dc (patch) | |
tree | 3f9c24589eae40244d3fc5a355de873e21ee1f0c | |
parent | a79ab969533320582482856758394e74739b152e (diff) | |
download | pixelterm-a1ce05f39b96f6992a8718ee4a192300f6db62dc.tar.gz pixelterm-a1ce05f39b96f6992a8718ee4a192300f6db62dc.tar.bz2 pixelterm-a1ce05f39b96f6992a8718ee4a192300f6db62dc.zip |
Small bugfix
-rwxr-xr-x | pixelterm | 11 | ||||
-rw-r--r--[-rwxr-xr-x] | pixelterm.py | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | unpixelterm.py | 0 |
3 files changed, 7 insertions, 4 deletions
@@ -15,12 +15,15 @@ if __name__ == '__main__': foo, _, _ = f.rpartition('.png') output = os.path.join(args.output_dir, os.path.basename(foo)+'.pony') metadata = json.loads(img.info.get('pixelterm-metadata')) - comment = metadata['_comment'] - del metadata['_comment'] + comment = metadata.get('_comment') + if comment is not None: + del metadata['_comment'] + comment = '\n'+comment + else: + comment = '' metadataarea = '$$$\n' +\ '\n'.join([ '\n'.join([ k.upper() + ': ' + v for v in metadata[k] ]) for k in sorted(metadata.keys()) ]) +\ - '\n' + comment +\ - '\n$$$\n' + comment + '\n$$$\n' with open(output, 'w') as of: of.write(metadataarea) of.write(pixelterm.termify_pixels(img)) diff --git a/pixelterm.py b/pixelterm.py index 1543663..1543663 100755..100644 --- a/pixelterm.py +++ b/pixelterm.py diff --git a/unpixelterm.py b/unpixelterm.py index 234d3d1..234d3d1 100755..100644 --- a/unpixelterm.py +++ b/unpixelterm.py |