/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/config.py

  • Committer: Aaron Bentley
  • Date: 2005-10-17 20:17:55 UTC
  • mfrom: (1185.16.59)
  • mto: (1185.25.1)
  • mto: This revision was merged to the branch mainline in revision 1474.
  • Revision ID: abentley@panoramicfeedback.com-20051017201755-48ed4650792388ab
Merged latest from Martin

Show diffs side-by-side

added added

removed removed

Lines of Context:
351
351
    return realname, (username + '@' + socket.gethostname())
352
352
 
353
353
 
 
354
def extract_email_address(e):
 
355
    """Return just the address part of an email string.
 
356
    
 
357
    That is just the user@domain part, nothing else. 
 
358
    This part is required to contain only ascii characters.
 
359
    If it can't be extracted, raises an error.
 
360
    
 
361
    >>> extract_email_address('Jane Tester <jane@test.com>')
 
362
    "jane@test.com"
 
363
    """
 
364
    m = re.search(r'[\w+.-]+@[\w+.-]+', e)
 
365
    if not m:
 
366
        raise BzrError("%r doesn't seem to contain "
 
367
                       "a reasonable email address" % e)
 
368
    return m.group(0)