This makes it more generally useful, since all future callers may not
have the input in a file.
Signed-off-by: Karl Hasselström <kha@treskal.com>
return (descr, authname, authemail, authdate, diff)
return (descr, authname, authemail, authdate, diff)
-def parse_patch(fobj):
- """Parse the input file and return (description, authname,
+def parse_patch(text):
+ """Parse the input text and return (description, authname,
authemail, authdate, diff)
"""
authemail, authdate, diff)
"""
- descr, diff = __split_descr_diff(fobj.read())
+ descr, diff = __split_descr_diff(text)
descr, authname, authemail, authdate = __parse_description(descr)
# we don't yet have an agreed place for the creation date.
descr, authname, authemail, authdate = __parse_description(descr)
# we don't yet have an agreed place for the creation date.
f = sys.stdin
else:
f = open(fname)
f = sys.stdin
else:
f = open(fname)
- message, author_name, author_email, author_date, diff = parse_patch(f)
+ (message, author_name, author_email, author_date, diff
+ ) = parse_patch(f.read())
f.close()
out.start('Updating patch "%s"' % pname)
f.close()
out.start('Updating patch "%s"' % pname)
parse_mail(msg)
else:
message, author_name, author_email, author_date, diff = \
parse_mail(msg)
else:
message, author_name, author_email, author_date, diff = \