diff options
| author | Martin Trigaux <mat@odoo.com> | 2020-06-04 12:39:11 +0200 |
|---|---|---|
| committer | Martin Trigaux <mat@odoo.com> | 2020-06-18 13:03:34 +0200 |
| commit | ba244cef01132347df4d2d9553ea3105ba13a938 (patch) | |
| tree | 20cdb55afb6b9f700bfe2844a90ca8de0050c941 /odoo/tools | |
| parent | 3c3b88f6768e31417263b3828a874ca204e29514 (diff) | |
[IMP] *: replace to new _() syntax
Using a few regex like
\((_\(.*%s.*)(\) % )([\w\[\]][\w .\[\]\(\)'"]*)\)
($1, $3))
Old syntax is still compatible but starts the migration to the new
syntax that catches error.
Diffstat (limited to 'odoo/tools')
| -rw-r--r-- | odoo/tools/image.py | 2 | ||||
| -rw-r--r-- | odoo/tools/template_inheritance.py | 2 | ||||
| -rw-r--r-- | odoo/tools/translate.py | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/odoo/tools/image.py b/odoo/tools/image.py index 590bdf1bbfa..3cde458e2db 100644 --- a/odoo/tools/image.py +++ b/odoo/tools/image.py @@ -86,7 +86,7 @@ class ImageProcess(): w, h = self.image.size if verify_resolution and w * h > IMAGE_MAX_RESOLUTION: - raise ValueError(_("Image size excessive, uploaded images must be smaller than %s million pixels.") % str(IMAGE_MAX_RESOLUTION / 10e6)) + raise ValueError(_("Image size excessive, uploaded images must be smaller than %s million pixels.", str(IMAGE_MAX_RESOLUTION / 10e6))) def image_base64(self, quality=0, output_format=''): """Return the base64 encoded image resulting of all the image processing diff --git a/odoo/tools/template_inheritance.py b/odoo/tools/template_inheritance.py index 33cedf7c12d..20a7d2aeee7 100644 --- a/odoo/tools/template_inheritance.py +++ b/odoo/tools/template_inheritance.py @@ -231,7 +231,7 @@ def apply_inheritance_specs(source, specs_tree, inherit_branding=False, pre_loca ]) tag = "<%s%s>" % (spec.tag, attrs) raise ValueError( - _("Element '%s' cannot be located in parent view") % tag + _("Element '%s' cannot be located in parent view", tag) ) return source diff --git a/odoo/tools/translate.py b/odoo/tools/translate.py index 745f2cd8cb0..e98ad4e9b7a 100644 --- a/odoo/tools/translate.py +++ b/odoo/tools/translate.py @@ -555,7 +555,7 @@ def TranslationFileReader(source, fileformat='po'): if fileformat == 'po': return PoFileReader(source) _logger.info('Bad file format: %s', fileformat) - raise Exception(_('Bad file format: %s') % fileformat) + raise Exception(_('Bad file format: %s', fileformat)) class CSVFileReader: def __init__(self, source): |
