Fix flake8
This commit is contained in:
1 parent
838d50b736
commit
5ad27258fd
4 files changed
+11
-7
No files matched your search
@@ -1,3 +1,5 @@
|
||||
#This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
#this repository contains the full copyright notices and license terms.
|
||||
from . import server
|
||||
|
||||
__all__ = ['server']
|
||||
@@ -13,6 +13,9 @@ import tempfile
|
||||
from sql import Flavor, Expression
|
||||
from sql.functions import Extract, Overlay, CharLength
|
||||
|
||||
__all__ = ['Database', 'DatabaseIntegrityError', 'DatabaseOperationalError',
|
||||
'Cursor']
|
||||
|
||||
|
||||
class MySQLExtract(Extract):
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ try:
|
||||
from hashlib import md5
|
||||
except ImportError:
|
||||
from md5 import md5
|
||||
from functools import reduce
|
||||
from lxml import etree
|
||||
from itertools import izip
|
||||
from sql import Column
|
||||
@@ -90,9 +89,9 @@ class Translation(ModelSQL, ModelView):
|
||||
'Translation must be unique'),
|
||||
]
|
||||
cls._error_messages.update({
|
||||
'translation_overridden': \
|
||||
'translation_overridden': (
|
||||
"You can not export translation %(name)s because it is an "
|
||||
"overridden translation by module %(overriding_module)s",
|
||||
"overridden translation by module %(overriding_module)s"),
|
||||
})
|
||||
|
||||
@classmethod
|
||||
|
||||
@@ -743,9 +743,9 @@ class ModelStorage(Model):
|
||||
ModelData = pool.get('ir.model.data')
|
||||
|
||||
# logger for collecting warnings for the client
|
||||
warnings = logging.Logger("import")
|
||||
logger = logging.Logger("import")
|
||||
warning_stream = StringIO.StringIO()
|
||||
warnings.addHandler(logging.StreamHandler(warning_stream))
|
||||
logger.addHandler(logging.StreamHandler(warning_stream))
|
||||
|
||||
len_fields_names = len(fields_names)
|
||||
assert all(len(x) == len_fields_names for x in data)
|
||||
@@ -893,7 +893,8 @@ class ModelStorage(Model):
|
||||
else:
|
||||
return all(method(r) for r in records)
|
||||
for field in cls._constraints:
|
||||
warnings.warn('_constraints is deprecated, override validate instead',
|
||||
warnings.warn(
|
||||
'_constraints is deprecated, override validate instead',
|
||||
DeprecationWarning, stacklevel=2)
|
||||
if not call(field[0]):
|
||||
cls.raise_user_error(field[1])
|
||||
@@ -1135,7 +1136,6 @@ class ModelStorage(Model):
|
||||
|
||||
cls.validate(records)
|
||||
|
||||
|
||||
@classmethod
|
||||
def _clean_defaults(cls, defaults):
|
||||
pool = Pool()
|
||||
|
||||
Reference in new issue
Block a user