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

Unified Diff: sitescripts/utils.py

Issue 29345242: Noissue - Adapt quotes for compliance with our coding style in sitescripts (Closed)
Patch Set: Fixed raw string Created May 30, 2016, 8:47 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
@@ -124,14 +124,14 @@
def encode_email_address(email):
- '''
+ """
Validates and encodes an email address.
The validation implemented here is very rudamentery and not meant
to be complete, as full email validation can get extremly complicated
and is rarely needed. This function is primarily making sure that the
email address contains no whitespaces and only valid ASCII characters.
- '''
+ """
match = re.search(r'^([^@\s]+)@([^@\s]+)$', email)
if not match:
raise ValueError
@@ -157,7 +157,7 @@
return _template_cache[key]
-@cached(float("inf"))
+@cached(float('inf'))
def get_template_environment(template_path):
"""
Returns a Jinja2 template environment with autoescaping enabled.
@@ -170,7 +170,7 @@
return env
-@cached(float("inf"))
+@cached(float('inf'))
def get_unescaped_template_environment(template_path):
"""
Returns a Jinja2 template environment without autoescaping. Don't use this to

Powered by Google App Engine
This is Rietveld