Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(514)

Side by Side Diff: util.py

Issue 23576004: Don't send mail for policy_checklist comments. (Closed) Base URL: https://git.chromium.org/git/chromium/tools/reviewbot.git@master
Patch Set: Address feedback. Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « rietveld.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import collections 5 import collections
6 import email.utils 6 import email.utils
7 7
8 8
9 def lazy_property(func): 9 def lazy_property(func):
10 """A decorator for lazy properties.""" 10 """A decorator for lazy properties."""
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 def get_emails(string): 79 def get_emails(string):
80 """Normalizes a string containing a list of email recepients. 80 """Normalizes a string containing a list of email recepients.
81 81
82 Takes a string in the format present in mail headers and returns a list of 82 Takes a string in the format present in mail headers and returns a list of
83 email addresses. For example, the input 83 email addresses. For example, the input
84 'test@example.com, committers <committers@chromium.org> 84 'test@example.com, committers <committers@chromium.org>
85 will produce this return value: 85 will produce this return value:
86 [ 'test@example.com', 'committers@chromium.org' ] 86 [ 'test@example.com', 'committers@chromium.org' ]
87 """ 87 """
88 return [entry[1] for entry in email.utils.getaddresses([string])] 88 return [entry[1] for entry in email.utils.getaddresses([string])]
89
90
91 def canonicalize_email(address):
92 """Takes an email address and returns its canonicalized form."""
93 emails = get_emails(address)
94 assert len(emails) == 1
95 return emails[0]
OLDNEW
« no previous file with comments | « rietveld.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698