mirror of
https://github.com/erkin/ponysay.git
synced 2025-01-31 18:36:43 +01:00
sort metadata tags on save
This commit is contained in:
parent
fb9f41794e
commit
4dcbee5dc9
1 changed files with 5 additions and 2 deletions
|
@ -758,7 +758,9 @@ class PonysayTool():
|
|||
comment = ('\n' + comment + '\n').replace('\n$$$\n', '\n\\$$$\n')[:-1]
|
||||
|
||||
meta = []
|
||||
for key in self.data:
|
||||
keys = [key for key in data]
|
||||
keys.sort()
|
||||
for key in keys:
|
||||
if (key == 'comment') or (len(self.data[key].strip()) == 0):
|
||||
continue
|
||||
values = self.data[key].strip()
|
||||
|
@ -767,6 +769,7 @@ class PonysayTool():
|
|||
|
||||
meta.append('WIDTH: ' + str(self.ponywidth))
|
||||
meta.append('HEIGHT: ' + str(self.ponyheight))
|
||||
# TODO auto fill in BALLOON {TOP,BOTTOM}
|
||||
meta.append(comment)
|
||||
meta = '\n'.join(meta)
|
||||
ponydata = '$$$\n' + meta + '\n$$$\n' + '\n'.join(self.image)
|
||||
|
@ -784,7 +787,7 @@ class PonysayTool():
|
|||
'''
|
||||
GNU Emacs alike text area
|
||||
'''
|
||||
class TextArea:
|
||||
class TextArea: # TODO support small screens
|
||||
'''
|
||||
Constructor
|
||||
|
||||
|
|
Loading…
Reference in a new issue