diff --git a/queue_job/__init__.py b/queue_job/__init__.py index a2c924c4aa..ce760dd194 100644 --- a/queue_job/__init__.py +++ b/queue_job/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from . import controllers from . import fields from . import models diff --git a/queue_job/__manifest__.py b/queue_job/__manifest__.py index 3eacd78fe3..1b09c57415 100644 --- a/queue_job/__manifest__.py +++ b/queue_job/__manifest__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) diff --git a/queue_job/controllers/main.py b/queue_job/controllers/main.py index afa2f10567..277e57632a 100644 --- a/queue_job/controllers/main.py +++ b/queue_job/controllers/main.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (c) 2015-2016 ACSONE SA/NV () # Copyright 2013-2016 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) diff --git a/queue_job/exception.py b/queue_job/exception.py index 87b86a59ad..5e266a2ee7 100644 --- a/queue_job/exception.py +++ b/queue_job/exception.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2012-2016 Camptocamp # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) diff --git a/queue_job/fields.py b/queue_job/fields.py index bb14840b01..5db6b11c92 100644 --- a/queue_job/fields.py +++ b/queue_job/fields.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # copyright 2016 Camptocamp # license agpl-3.0 or later (http://www.gnu.org/licenses/agpl.html) diff --git a/queue_job/job.py b/queue_job/job.py index 7e0d502d62..99a3e16924 100644 --- a/queue_job/job.py +++ b/queue_job/job.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2013-2016 Camptocamp # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) diff --git a/queue_job/jobrunner/__init__.py b/queue_job/jobrunner/__init__.py index 44fa54a330..a721f2e773 100644 --- a/queue_job/jobrunner/__init__.py +++ b/queue_job/jobrunner/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (c) 2015-2016 ACSONE SA/NV () # Copyright 2016 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) diff --git a/queue_job/jobrunner/channels.py b/queue_job/jobrunner/channels.py index ace9ce6f59..bd55b99b7a 100644 --- a/queue_job/jobrunner/channels.py +++ b/queue_job/jobrunner/channels.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (c) 2015-2016 ACSONE SA/NV () # Copyright 2015-2016 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) @@ -114,6 +113,7 @@ class SafeSet(set): >>> s.remove(1) """ def remove(self, o): + # pylint: disable=missing-return,except-pass try: super(SafeSet, self).remove(o) except KeyError: diff --git a/queue_job/jobrunner/runner.py b/queue_job/jobrunner/runner.py index d40fef38bc..0e334c17fc 100644 --- a/queue_job/jobrunner/runner.py +++ b/queue_job/jobrunner/runner.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (c) 2015-2016 ACSONE SA/NV () # Copyright 2015-2016 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) @@ -231,6 +230,10 @@ def __init__(self, db_name): self._initialize() def close(self): + # pylint: disable=except-pass + # if close fail for any reason, it's either because it's already closed + # and we don't care, or for any reason but anyway it will be closed on + # del try: self.conn.close() except: @@ -277,6 +280,10 @@ def _initialize(self): cr.execute("LISTEN queue_job") def select_jobs(self, where, args): + # pylint: disable=sql-injection + # the checker thinks we are injecting values but we are not, we are + # adding the where conditions, values are added later properly with + # parameters query = ("SELECT channel, uuid, id as seq, date_created, " "priority, EXTRACT(EPOCH FROM eta), state " "FROM queue_job WHERE %s" % diff --git a/queue_job/migrations/10.0.1.0.0/pre-migration.py b/queue_job/migrations/10.0.1.0.0/pre-migration.py deleted file mode 100644 index db4c33a73f..0000000000 --- a/queue_job/migrations/10.0.1.0.0/pre-migration.py +++ /dev/null @@ -1,29 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2017 Tecnativa - Vicent Cubells -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). - - -def migrate(cr, version): - if not version: - return - # In order to migrate connector from v9 to v10, we need to set - # connector module state to 'to upgrade'. If this is not done, all - # connector.* xmlids are removed due to the module renaming done by - # OpenUpgrade. In the future the approach sketched in - # https://github.com/OCA/queue/pull/23#issuecomment-325706811 - # may provide a more generic solution. - cr.execute(""" - UPDATE ir_module_module - SET state='to upgrade' - WHERE name='connector' - """) - try: - from openupgradelib import openupgrade - openupgrade.rename_xmlids( - cr, [ - ('queue_job.group_connector_manager', - 'queue_job.group_queue_job_manager',) - ], - ) - except ImportError: - pass diff --git a/queue_job/models/__init__.py b/queue_job/models/__init__.py index e7266a7f86..0909032522 100644 --- a/queue_job/models/__init__.py +++ b/queue_job/models/__init__.py @@ -1,4 +1,2 @@ -# -*- coding: utf-8 -*- - from . import base from . import queue_job diff --git a/queue_job/models/base.py b/queue_job/models/base.py index a966c3ce68..e8946a26a9 100644 --- a/queue_job/models/base.py +++ b/queue_job/models/base.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2016 Camptocamp # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) diff --git a/queue_job/models/queue_job.py b/queue_job/models/queue_job.py index da4665c3d4..e674a37366 100644 --- a/queue_job/models/queue_job.py +++ b/queue_job/models/queue_job.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2013-2016 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) @@ -53,18 +52,17 @@ class QueueJob(models.Model): readonly=True, store=True) state = fields.Selection(STATES, - string='State', readonly=True, required=True, index=True) priority = fields.Integer() exc_info = fields.Text(string='Exception Info', readonly=True) - result = fields.Text(string='Result', readonly=True) + result = fields.Text(readonly=True) date_created = fields.Datetime(string='Created Date', readonly=True) date_started = fields.Datetime(string='Start Date', readonly=True) date_enqueued = fields.Datetime(string='Enqueue Time', readonly=True) - date_done = fields.Datetime(string='Date Done', readonly=True) + date_done = fields.Datetime(readonly=True) eta = fields.Datetime(string='Execute only after') retry = fields.Integer(string='Current try') @@ -252,7 +250,6 @@ class JobChannel(models.Model): name = fields.Char() complete_name = fields.Char(compute='_compute_complete_name', - string='Complete Name', store=True, readonly=True) parent_id = fields.Many2one(comodel_name='queue.job.channel', diff --git a/queue_job/tests/__init__.py b/queue_job/tests/__init__.py index 471c7d634a..5b16170b28 100644 --- a/queue_job/tests/__init__.py +++ b/queue_job/tests/__init__.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - from . import test_runner_channels from . import test_runner_runner from . import test_json_field diff --git a/queue_job/tests/common.py b/queue_job/tests/common.py index 40a96afc6f..e69de29bb2 100644 --- a/queue_job/tests/common.py +++ b/queue_job/tests/common.py @@ -1 +0,0 @@ -# -*- coding: utf-8 -*- diff --git a/queue_job/tests/test_json_field.py b/queue_job/tests/test_json_field.py index 2b34c635c4..6c5e8f1e36 100644 --- a/queue_job/tests/test_json_field.py +++ b/queue_job/tests/test_json_field.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # copyright 2016 Camptocamp # license agpl-3.0 or later (http://www.gnu.org/licenses/agpl.html) @@ -6,6 +5,9 @@ import json from odoo.tests import common + +# pylint: disable=odoo-addons-relative-import +# we are testing, we want to test as we were an external consumer of the API from odoo.addons.queue_job.fields import JobEncoder, JobDecoder diff --git a/queue_job/tests/test_runner_channels.py b/queue_job/tests/test_runner_channels.py index b5e8db6af7..261229ce6e 100644 --- a/queue_job/tests/test_runner_channels.py +++ b/queue_job/tests/test_runner_channels.py @@ -1,8 +1,9 @@ -# -*- coding: utf-8 -*- # Copyright 2015-2016 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) import doctest +# pylint: disable=odoo-addons-relative-import +# we are testing, we want to test as we were an external consumer of the API from odoo.addons.queue_job.jobrunner import channels diff --git a/queue_job/tests/test_runner_runner.py b/queue_job/tests/test_runner_runner.py index 86c6ec06f4..ebfd6540c1 100644 --- a/queue_job/tests/test_runner_runner.py +++ b/queue_job/tests/test_runner_runner.py @@ -1,8 +1,9 @@ -# -*- coding: utf-8 -*- # Copyright 2015-2016 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) import doctest +# pylint: disable=odoo-addons-relative-import +# we are testing, we want to test as we were an external consumer of the API from odoo.addons.queue_job.jobrunner import runner diff --git a/queue_job/views/queue_job_views.xml b/queue_job/views/queue_job_views.xml index 98aa693748..2035f12396 100644 --- a/queue_job/views/queue_job_views.xml +++ b/queue_job/views/queue_job_views.xml @@ -81,9 +81,9 @@ queue.job.tree queue.job - + @@ -189,7 +189,7 @@ queue.job.channel.tree queue.job.channel - + @@ -233,7 +233,7 @@ queue.job.function.tree queue.job.function - + diff --git a/queue_job_subscribe/__init__.py b/queue_job_subscribe/__init__.py index be6850e6e0..6a125affcd 100644 --- a/queue_job_subscribe/__init__.py +++ b/queue_job_subscribe/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2016 Cédric Pigeon # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import models diff --git a/queue_job_subscribe/__manifest__.py b/queue_job_subscribe/__manifest__.py index df4aff3859..f9f0abef69 100644 --- a/queue_job_subscribe/__manifest__.py +++ b/queue_job_subscribe/__manifest__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2016 Cédric Pigeon # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). {'name': 'Queue Job Subscribe', diff --git a/queue_job_subscribe/models/__init__.py b/queue_job_subscribe/models/__init__.py index 28ed65eada..b5dc1e9f81 100644 --- a/queue_job_subscribe/models/__init__.py +++ b/queue_job_subscribe/models/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2016 Cédric Pigeon # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). diff --git a/queue_job_subscribe/models/queue_job.py b/queue_job_subscribe/models/queue_job.py index c6e1d43f2b..aafd26b84d 100644 --- a/queue_job_subscribe/models/queue_job.py +++ b/queue_job_subscribe/models/queue_job.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2016 Cédric Pigeon # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). diff --git a/queue_job_subscribe/models/res_users.py b/queue_job_subscribe/models/res_users.py index 4bba2fa917..2634d76080 100644 --- a/queue_job_subscribe/models/res_users.py +++ b/queue_job_subscribe/models/res_users.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2016 Cédric Pigeon # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). diff --git a/queue_job_subscribe/tests/__init__.py b/queue_job_subscribe/tests/__init__.py index 34e6cd2605..292a860ce5 100644 --- a/queue_job_subscribe/tests/__init__.py +++ b/queue_job_subscribe/tests/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2016 Cédric Pigeon # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). diff --git a/queue_job_subscribe/tests/test_job_subscribe.py b/queue_job_subscribe/tests/test_job_subscribe.py index 97eb345808..d6480ae9a0 100644 --- a/queue_job_subscribe/tests/test_job_subscribe.py +++ b/queue_job_subscribe/tests/test_job_subscribe.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2016 Cédric Pigeon # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). diff --git a/test_queue_job/__init__.py b/test_queue_job/__init__.py index a0fdc10fe1..0650744f6b 100644 --- a/test_queue_job/__init__.py +++ b/test_queue_job/__init__.py @@ -1,2 +1 @@ -# -*- coding: utf-8 -*- from . import models diff --git a/test_queue_job/__manifest__.py b/test_queue_job/__manifest__.py index dab5e0affd..25e1a5b847 100644 --- a/test_queue_job/__manifest__.py +++ b/test_queue_job/__manifest__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2016 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) diff --git a/test_queue_job/models/__init__.py b/test_queue_job/models/__init__.py index 153d090f53..483288c9af 100644 --- a/test_queue_job/models/__init__.py +++ b/test_queue_job/models/__init__.py @@ -1,3 +1 @@ -# -*- coding: utf-8 -*- - from . import test_models diff --git a/test_queue_job/models/test_models.py b/test_queue_job/models/test_models.py index b76dbab738..ca681a1181 100644 --- a/test_queue_job/models/test_models.py +++ b/test_queue_job/models/test_models.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2016 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) diff --git a/test_queue_job/tests/__init__.py b/test_queue_job/tests/__init__.py index 63498a9eae..1e8aadf727 100644 --- a/test_queue_job/tests/__init__.py +++ b/test_queue_job/tests/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from . import test_job from . import test_job_channels from . import test_related_actions diff --git a/test_queue_job/tests/test_job.py b/test_queue_job/tests/test_job.py index d37125d21c..f5586ca718 100644 --- a/test_queue_job/tests/test_job.py +++ b/test_queue_job/tests/test_job.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2016 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) diff --git a/test_queue_job/tests/test_job_channels.py b/test_queue_job/tests/test_job_channels.py index 06fe25f9de..3b9e385fc1 100644 --- a/test_queue_job/tests/test_job_channels.py +++ b/test_queue_job/tests/test_job_channels.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2016 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) diff --git a/test_queue_job/tests/test_related_actions.py b/test_queue_job/tests/test_related_actions.py index d8d41cf2a6..eb373492ec 100644 --- a/test_queue_job/tests/test_related_actions.py +++ b/test_queue_job/tests/test_related_actions.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2014-2016 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)