# Test utils.fix_maintainer()
# Copyright (C) 2004 James Troup <james@nocrew.org>
-# $Id: test.py,v 1.1 2004-04-03 02:49:54 troup Exp $
+# $Id: test.py,v 1.2 2004-06-23 23:11:51 troup Exp $
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
xd = "james@nocrew.org"
check_valid(s, xa, xb, xc, xd);
+ # Check bracketed just-email form
+ s = "<james@nocrew.org>"
+ xa = " <james@nocrew.org>"
+ xb = " <james@nocrew.org>"
+ xc = ""
+ xd = "james@nocrew.org"
+ check_valid(s, xa, xb, xc, xd);
+
# Check Krazy quoted-string local part email address
s = "Cris van Pelt <\"Cris van Pelt\"@tribe.eu.org>"
xa = "Cris van Pelt <\"Cris van Pelt\"@tribe.eu.org>"
# Utility functions
# Copyright (C) 2000, 2001, 2002, 2003, 2004 James Troup <james@nocrew.org>
-# $Id: utils.py,v 1.67 2004-04-07 14:23:30 dsilvers Exp $
+# $Id: utils.py,v 1.68 2004-06-23 23:11:47 troup Exp $
################################################################################
if not maintainer:
return ('', '', '', '');
- if maintainer.find("<") == -1 or (maintainer[0] == "<" and \
- maintainer[-1:] == ">"):
+ if maintainer.find("<") == -1:
email = maintainer;
name = "";
+ elif (maintainer[0] == "<" and maintainer[-1:] == ">"):
+ email = maintainer[1:-1];
+ name = "";
else:
m = re_parse_maintainer.match(maintainer);
if not m: