cubicweb/hooks/test/data/hooks.py
author Philippe Pepiot <philippe.pepiot@logilab.fr>
Mon, 29 Oct 2018 10:04:31 +0100
branch3.26
changeset 12432 2fcb53ee5178
parent 11129 97095348b3ee
permissions -rw-r--r--
Fix flake8 issues since release 3.6.0 Flake8 had a new release which raise new issues, namely: W504: line break after binary operator F841: local variable 'ex' is assigned to but never used W605: invalid escape sequence F821: undefined name 'buffer' (noqa seems the only way to avoid this false positive) Also pin flake8>=3.6 in our tests and make explicit that we use python3 to run flake8 tests.

from cubicweb.predicates import is_instance
from cubicweb.hooks import notification


class FolderUpdateHook(notification.EntityUpdateHook):
    __select__ = (notification.EntityUpdateHook.__select__
                  & is_instance('Folder'))
    order = 100  # late trigger so that metadata hooks come before.