+ print 'done'
+
+def __import_file(patch, filename, options):
+ """Import a patch from a file or standard input
+ """
+ if filename:
+ f = file(filename)
+ else:
+ f = sys.stdin
+
+ if options.mail:
+ try:
+ msg = email.message_from_file(f)
+ except Exception, ex:
+ raise CmdException, 'error parsing the e-mail file: %s' % str(ex)
+ message, author_name, author_email, author_date, diff = \
+ __parse_mail(msg)
+ else:
+ message, author_name, author_email, author_date, diff = \
+ __parse_patch(f)
+
+ if filename:
+ f.close()
+
+ __create_patch(patch, message, author_name, author_email,
+ author_date, diff, options)