Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix flake8 #31

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ckanext/fluent/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


def fluent_form_languages(field=None, entity_type=None, object_type=None,
schema=None):
schema=None):
"""
Return a list of language codes for this form (or form field)

Expand Down
1 change: 0 additions & 1 deletion ckanext/fluent/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from ckanext.fluent import validators, helpers



class FluentPlugin(p.SingletonPlugin):
p.implements(p.IValidators)
p.implements(p.IConfigurer)
Expand Down
9 changes: 5 additions & 4 deletions ckanext/fluent/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@

@scheming_validator
def fluent_core_translated_output(field, schema):
assert field['field_name'].endswith(LANG_SUFFIX), 'Output validator "fluent_core_translated" must only used on a field that ends with "_translated"'
assert field['field_name'].endswith(LANG_SUFFIX), \
'Output validator "fluent_core_translated" must only used on a field that ends with "_translated"'

def validator(key, data, errors, context):
"""
Expand Down Expand Up @@ -99,7 +100,7 @@ def validator(key, data, errors, context):
m = re.match(BCP_47_LANGUAGE, lang)
except TypeError:
errors[key].append(_('invalid type for language code: %r')
% lang)
% lang)
continue
if not m:
errors[key].append(_('invalid language code: "%s"') % lang)
Expand All @@ -112,7 +113,7 @@ def validator(key, data, errors, context):
value[lang] = text.decode('utf-8')
except UnicodeDecodeError:
errors[key]. append(_('invalid encoding for "%s" value')
% lang)
% lang)

for lang in required_langs:
if value.get(lang) or any(
Expand Down Expand Up @@ -223,7 +224,7 @@ def validator(key, data, errors, context):
m = re.match(BCP_47_LANGUAGE, lang)
except TypeError:
errors[key].append(_('invalid type for language code: %r')
% lang)
% lang)
continue
if not m:
errors[key].append(_('invalid language code: "%s"') % lang)
Expand Down
6 changes: 2 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from setuptools import setup, find_packages
import sys, os

version = '1.0.0'

Expand All @@ -9,7 +8,7 @@
description="Multilingual fields for CKAN",
long_description="""
""",
classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
keywords='',
author='Government of Canada',
author_email='ian@excess.org',
Expand All @@ -22,8 +21,7 @@
install_requires=[
# -*- Extra requirements: -*-
],
entry_points=\
"""
entry_points="""
[ckan.plugins]
fluent=ckanext.fluent.plugins:FluentPlugin
""",
Expand Down