Fix flake8

This commit is contained in:
Cédric Krier committed 2013-02-27 22:56:31 +01:00
1 parent 2fc2f4eae4
commit 5cd899078a
3 files changed
+21 -20

No files matched your search

+1 -1
View File
@@ -763,7 +763,7 @@ class Model(object):
values = self._get_on_change_value()
if self._parent:
values['_parent_%s' % self._parent_name] = \
_EvalEnvironment(self._parent)
_EvalEnvironment(self._parent)
for arg in args:
scope = values
for i in arg.split('.'):
+13 -13
View File
@@ -187,10 +187,10 @@ class And(PYSON):
for statement in statements:
if isinstance(statement, PYSON):
assert statement.types() == set([bool]), \
'statement must be boolean'
'statement must be boolean'
else:
assert isinstance(statement, bool), \
'statement must be boolean'
'statement must be boolean'
assert len(statements) >= 2, 'must have at least 2 statements'
self._statements = list(statements)
@@ -258,10 +258,10 @@ class Greater(PYSON):
for i in (statement1, statement2):
if isinstance(i, PYSON):
assert i.types().issubset(set([int, long, float])), \
'statement must be an integer or a float'
'statement must be an integer or a float'
else:
assert isinstance(i, (int, long, float)), \
'statement must be an integer or a float'
'statement must be an integer or a float'
if isinstance(equal, PYSON):
assert equal.types() == set([bool])
else:
@@ -319,10 +319,10 @@ class If(PYSON):
then_types = set([type(then_statement)])
if isinstance(else_statement, PYSON):
assert then_types == else_statement.types(), \
'then and else statements must be the same type'
'then and else statements must be the same type'
else:
assert then_types == set([type(else_statement)]), \
'then and else statements must be the same type'
'then and else statements must be the same type'
self._condition = condition
self._then_statement = then_statement
self._else_statement = else_statement
@@ -390,13 +390,13 @@ class In(PYSON):
super(In, self).__init__()
if isinstance(key, PYSON):
assert key.types().issubset(set([str, int, long])), \
'key must be a string or an integer or a long'
'key must be a string or an integer or a long'
else:
assert type(key) in [str, int, long], \
'key must be a string or an integer or a long'
'key must be a string or an integer or a long'
if isinstance(obj, PYSON):
assert obj.types().issubset(set([dict, list])), \
'obj must be a dict or a list'
'obj must be a dict or a list'
if obj.types() == set([dict]):
assert type(key) == str, 'key must be a string'
else:
@@ -429,10 +429,10 @@ class Date(PYSON):
for i in (year, month, day, delta_years, delta_months, delta_days):
if isinstance(i, PYSON):
assert i.types().issubset(set([int, long, type(None)])), \
'%s must be an integer or None' % (i,)
'%s must be an integer or None' % (i,)
else:
assert isinstance(i, (int, long, type(None))), \
'%s must be an integer or None' % (i,)
'%s must be an integer or None' % (i,)
self._year = year
self._month = month
self._day = day
@@ -480,10 +480,10 @@ class DateTime(Date):
delta_hours, delta_minutes, delta_seconds, delta_microseconds):
if isinstance(i, PYSON):
assert i.types() == set([int, long, type(None)]), \
'%s must be an integer or None' % (i,)
'%s must be an integer or None' % (i,)
else:
assert isinstance(i, (int, long, type(None))), \
'%s must be an integer or None' % (i,)
'%s must be an integer or None' % (i,)
self._hour = hour
self._minute = minute
self._second = second
+7 -6
View File
@@ -20,8 +20,8 @@ setup(name='proteus',
author='B2CK',
author_email='info@b2ck.com',
url='http://www.tryton.org/',
download_url="http://downloads.tryton.org/" + \
proteus.__version__.rsplit('.', 1)[0] + '/',
download_url=("http://downloads.tryton.org/" +
proteus.__version__.rsplit('.', 1)[0] + '/'),
packages=find_packages(),
classifiers=[
'Development Status :: 5 - Production/Stable',
@@ -30,12 +30,13 @@ setup(name='proteus',
'Intended Audience :: Developers',
'Intended Audience :: Financial and Insurance Industry',
'Intended Audience :: Legal Industry',
'License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)',
'License :: OSI Approved :: '
'GNU Library or Lesser General Public License (LGPL)',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Topic :: Office/Business',
],
],
license='LGPL-3',
install_requires=[
"python-dateutil",
@@ -45,8 +46,8 @@ setup(name='proteus',
(major_version, minor_version, major_version, minor_version + 1)],
'simplejson': ['simplejson'],
'cdecimal': ['cdecimal'],
},
},
test_suite='proteus.tests',
tests_require=('trytond >= %s.%s, < %s.%s' %
(major_version, minor_version, major_version, minor_version + 1))
)
)