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, 11:39 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
« no previous file with comments | « sitescripts/reports/web/showUser.py ('k') | sitescripts/web.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « sitescripts/reports/web/showUser.py ('k') | sitescripts/web.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld