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

Unified Diff: cms/sources.py

Issue 29756692: Noissue - Adapt best practices for trailing commas (cms) (Closed)
Patch Set: More cleanup, added flake8-commas extension Created April 19, 2018, 2:19 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 | « cms/converters.py ('k') | cms/utils.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cms/sources.py
===================================================================
--- a/cms/sources.py
+++ b/cms/sources.py
@@ -115,10 +115,8 @@
def list_localizable_files(self):
default_locale = self.read_config().get('general', 'defaultlocale')
- return filter(
- lambda f: os.path.splitext(f)[1].lower() != '.json',
- self.list_files('locales/%s' % default_locale)
- )
+ return filter(lambda f: os.path.splitext(f)[1].lower() != '.json',
+ self.list_files('locales/%s' % default_locale))
def has_localizable_file(self, locale, filename):
return self.has_file(self.localizable_file_filename(locale, filename))
@@ -182,18 +180,15 @@
except KeyError as ke:
if ke.message != 'message':
raise
- raise ValueError(
- 'The content of translations file for page "{}", '
- 'language "{}" ({}) is not a valid translations file: '
- '"message" key is missing for string: "{}"'
- .format(page, locale, filepath, key)
- )
+ raise ValueError('The content of translations file for page '
+ '"{}", language "{}" ({}) is not a valid '
+ 'translations file: "message" key is missing '
+ 'for string: "{}"'.format(page, locale,
+ filepath, key))
except (AttributeError, ValueError):
- raise ValueError(
- 'The content of translations file for page "{}", '
- 'language "{}" ({}) is not a valid JSON dictionary'
- .format(page, locale, filepath)
- )
+ raise ValueError('The content of translations file for page '
+ '"{}", language "{}" ({}) is not a valid '
+ 'JSON object'.format(page, locale, filepath))
return result
« no previous file with comments | « cms/converters.py ('k') | cms/utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld