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: Created May 29, 2016, 1:26 p.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/urlfixer/web/submitData.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
@@ -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
« no previous file with comments | « sitescripts/urlfixer/web/submitData.py ('k') | sitescripts/web.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld