+
+def name_email(string):
+ """Return a tuple consisting of the name and email parsed from a
+ standard 'name <email>' string
+ """
+ names = re.split('([^<>]*)<([^<>]*)>', string)
+ if len(names) != 4:
+ raise CmdException, 'Incorrect "name <email>" string: %s' % string
+
+ return tuple([names[1].strip(), names[2].strip()])