from optparse import OptionParser, make_option
from stgit.commands.common import *
from optparse import OptionParser, make_option
from stgit.commands.common import *
def __parse_description(descr):
"""Parse the patch description and return the new description and
author information (if any).
def __parse_description(descr):
"""Parse the patch description and return the new description and
author information (if any).
"""Parse the input file in a mail format and return (description,
authname, authemail, authdate)
"""
"""Parse the input file in a mail format and return (description,
authname, authemail, authdate)
"""
+ def __decode_header(header):
+ """Decode a qp-encoded e-mail header as per rfc2047"""
+ try:
+ words_enc = decode_header(header)
+ hobj = make_header(words_enc)
+ except Exception, ex:
+ raise CmdException, 'header decoding error: %s' % str(ex)
+ return unicode(hobj).encode('utf-8')
+
authname, authemail = name_email(auth)
elif re.match('date:\s+', line, re.I):
authdate = re.findall('^.*?:\s+(.*)$', line)[0]
elif re.match('subject:\s+', line, re.I):
authname, authemail = name_email(auth)
elif re.match('date:\s+', line, re.I):
authdate = re.findall('^.*?:\s+(.*)$', line)[0]
elif re.match('subject:\s+', line, re.I):
message, author_name, author_email, author_date = \
__parse_patch(filename)
message, author_name, author_email, author_date = \
__parse_patch(filename)