Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: sitescripts/utils.py

Issue 8793015: Reports - user profile (Closed)
Patch Set: Reports - user profile Created Nov. 7, 2012, 9:38 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sitescripts/utils.py
===================================================================
--- a/sitescripts/utils.py
+++ b/sitescripts/utils.py
@@ -15,7 +15,7 @@
# You should have received a copy of the GNU General Public License
# along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
-import os, sys, codecs, subprocess, sitescripts
+import os, sys, re, codecs, subprocess, sitescripts
from time import time
from tempfile import mkstemp
from ConfigParser import SafeConfigParser
@@ -85,6 +85,12 @@
"""
sys.stderr = codecs.getwriter('utf8')(stream)
+def anonymizeMail(email):
+ """
+ Anonymizes email to look like a**.n***@g****.c**
+ """
+ return re.sub(r'(?<=[^.@])[^.@]', '*', email)
+
def sendMail(template, data):
"""
Sends a mail generated from the template and data given.

Powered by Google App Engine
This is Rietveld