mirror of
https://github.com/erkin/ponysay.git
synced 2025-03-29 14:57:43 +01:00
metadata read fix in ponysay-tool + fix documentation on metadata
Signed-off-by: Mattias Andrée <maandree@operamail.com>
This commit is contained in:
parent
f86b16d702
commit
fba2fbf862
2 changed files with 10 additions and 6 deletions
|
@ -2379,11 +2379,15 @@ begins with a line with exactly 3 dollar signs and nothing else (@code{$$$}), an
|
||||||
end in the same way direct follow by the pony image starting from the next line.
|
end in the same way direct follow by the pony image starting from the next line.
|
||||||
|
|
||||||
A metadata tag consists of a tag name in upper case and a tag value, with a colon
|
A metadata tag consists of a tag name in upper case and a tag value, with a colon
|
||||||
(@code{:}), optionally with regular spaces or tab spaces. Multiple tag names can
|
(@code{:}), optionally with surrounding regular spaces or tab spaces, but at least
|
||||||
be used multiple times or can be completely skipped. There are only a few tags,
|
one regular space or tab space directly after the colon. The name can only consist
|
||||||
namely @var{BALLOON TOP}, @var{BALLOON BOTTOM}, @var{MASTER}, @var{FREE}, that
|
of A to Z (upper case ASCII letters) and regular spaces. All tab spaces in the tag
|
||||||
absolutely should not be used muliple tag; a general rule is that a tag desribing
|
names and values are handled as regular spaces. Multiple tag names can be used
|
||||||
a pony should be duplicated exactly as many times as there are ponies in the image.
|
multiple times or can be completely skipped. There are only a few tags, namely
|
||||||
|
@var{BALLOON TOP}, @var{BALLOON BOTTOM}, @var{MASTER} and @var{FREE}, that absolutely
|
||||||
|
should not be used muliple tag, but nor should @var{WIDTH} and @var{HEIGHT}; a
|
||||||
|
general rule is that a tag desribing a pony should be duplicated exactly as many
|
||||||
|
times as there are ponies in the image.
|
||||||
|
|
||||||
Any line that does not conform to the format of a tag line is a part of the comment
|
Any line that does not conform to the format of a tag line is a part of the comment
|
||||||
field. Leading line breaks in the comment field is ignored.
|
field. Leading line breaks in the comment field is ignored.
|
||||||
|
|
|
@ -702,7 +702,7 @@ class PonysayTool():
|
||||||
data = {}
|
data = {}
|
||||||
comment = []
|
comment = []
|
||||||
for line in meta:
|
for line in meta:
|
||||||
if ': ' in line:
|
if ': ' in line.replace('\t', ' '):
|
||||||
key = line.replace('\t', ' ')
|
key = line.replace('\t', ' ')
|
||||||
key = key[:key.find(': ')]
|
key = key[:key.find(': ')]
|
||||||
test = key
|
test = key
|
||||||
|
|
Loading…
Add table
Reference in a new issue