newformat format change
Aaron Bentley
aaron.bentley at utoronto.ca
Sat Oct 1 00:04:37 BST 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Gustavo Niemeyer wrote:
>>RFC822 formatting doesn't group data that way. Or rather, the
>>.rsyncexclude data would be the message body.
>
>
> Sorry. I should have said rfc822-styled.
That's a significant difference-- it means we have no spec, validators,
parsers, etc. As a counterexample, Arch patchlogs *are* RFC822
formatted, which means that PyArch & PyBaz can (and do) use Python's
built-in email parsers.
Python's ConfigParser files are almost the same format as the one you
propose, but have presumably had much more testing.
> print >>f, "RootID:", inv.root.file_id
I don't see any character encoding handling, and the escaping appears
inconsistent (AFAIK, newlines and tabs are permitted in file_ids).
It would probably be smart to define one function to write values to the
file, and use that instead. e.g.
def add_value(f, name, value):
f.write(name.encode('utf-8')+":")
lines = rev.message.splitlines()
if len(lines) > 1:
prefix = '\t'
else:
prefix = ''
for line in lines:
print >>f, prefix+line.encode('utf-8')
Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFDPcSF0F+nu1YWqI0RAjD2AJ43fZQVjBVUQoKdq1dmJVuezA5NCgCeOqso
3TYNhaEPA7zLD1gY83DuA8I=
=Wltu
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list