flake8-ok-files.txt
author Sylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 20 Jan 2017 18:17:04 +0100
changeset 11919 3a6746dfc57f
parent 11911 37726f66ff82
child 11929 fcbd6b251d81
permissions -rw-r--r--
Change hooks control (deny_all_hooks_but / allow_all_hooks_but) to be more predictable Prior to this, if one execute code like: with cnx.hooks.deny_all_hooks_but('metadata'): with cnx.hooks.deny_all_hooks_but(): # mycode 'metadata' hooks will be activated anyway in the inner block, which is rather unexpected (of course in real life you only see the latest hooks control statement, the former being higher in the call stack). This is due to the underlying usage of old `enable_hook_categories` / `disable_hook_categories` methods, which were introduced much before the now official context manager based API (with `cnx.[deny|all]_all_hooks_but(...)`). To move on, this patch drop the two legacy methods, rename and privatize related internal state on the connection (`hooks_mode` becomes `_hooks_mode`, `disabled_hook_cats` and `enabled_hook_cats` become `_hooks_categories`) and reimplement the `_hooks_control` context manager to simply update them. See the added unit test for details.

cubicweb/__init__.py
cubicweb/__main__.py
cubicweb/dataimport/csv.py
cubicweb/dataimport/importer.py
cubicweb/dataimport/massive_store.py
cubicweb/dataimport/stores.py
cubicweb/dataimport/test/data-massimport/schema.py
cubicweb/dataimport/test/data/schema.py
cubicweb/dataimport/test/test_csv.py
cubicweb/dataimport/test/test_pgstore.py
cubicweb/dataimport/test/test_massive_store.py
cubicweb/dataimport/test/test_stores.py
cubicweb/dataimport/test/unittest_importer.py
cubicweb/devtools/test/data/cubes/i18ntestcube/__init__.py
cubicweb/devtools/test/data/cubes/__init__.py
cubicweb/devtools/test/data/schema.py
cubicweb/devtools/testlib.py
cubicweb/devtools/test/unittest_devctl.py
cubicweb/devtools/test/unittest_i18n.py
cubicweb/devtools/test/unittest_webtest.py
cubicweb/devtools/webtest.py
cubicweb/entities/adapters.py
cubicweb/entities/test/unittest_base.py
cubicweb/etwist/__init__.py
cubicweb/etwist/request.py
cubicweb/etwist/service.py
cubicweb/ext/__init__.py
cubicweb/hooks/test/data/hooks.py
cubicweb/hooks/test/unittest_notificationhooks.py
cubicweb/hooks/test/unittest_security.py
cubicweb/hooks/test/unittest_syncsession.py
cubicweb/pylintext.py
cubicweb/rset.py
cubicweb/rtags.py
cubicweb/server/repository.py
cubicweb/server/rqlannotation.py
cubicweb/server/schema2sql.py
cubicweb/server/session.py
cubicweb/server/sqlutils.py
cubicweb/server/test/datacomputed/migratedapp/schema.py
cubicweb/server/test/datacomputed/schema.py
cubicweb/server/test/data/entities.py
cubicweb/server/test/data-migractions/cubes/fakecustomtype/__init__.py
cubicweb/server/test/data-migractions/cubes/fakeemail/__init__.py
cubicweb/server/test/data-migractions/cubes/__init__.py
cubicweb/server/test/data-migractions/migratedapp/__init__.py
cubicweb/server/test/data-schema2sql/__init__.py
cubicweb/server/test/unittest_checkintegrity.py
cubicweb/server/test/unittest_ldapsource.py
cubicweb/server/test/unittest_session.py
cubicweb/sobjects/test/unittest_notification.py
cubicweb/sobjects/test/unittest_register_user.py
cubicweb/sobjects/textparsers.py
cubicweb/test/data/libpython/cubicweb_comment/__init__.py
cubicweb/test/data/libpython/cubicweb_comment/__pkginfo__.py
cubicweb/test/data/libpython/cubicweb_email/entities.py
cubicweb/test/data/libpython/cubicweb_email/hooks.py
cubicweb/test/data/libpython/cubicweb_email/__init__.py
cubicweb/test/data/libpython/cubicweb_email/__pkginfo__.py
cubicweb/test/data/libpython/cubicweb_email/views/__init__.py
cubicweb/test/data/libpython/cubicweb_file/entities/__init__.py
cubicweb/test/data/libpython/cubicweb_file/hooks/__init__.py
cubicweb/test/data/libpython/cubicweb_file/__init__.py
cubicweb/test/data/libpython/cubicweb_file/__pkginfo__.py
cubicweb/test/data/libpython/cubicweb_file/views.py
cubicweb/test/data/libpython/cubicweb_forge/__init__.py
cubicweb/test/data/libpython/cubicweb_forge/__pkginfo__.py
cubicweb/test/data/libpython/cubicweb_mycube/__init__.py
cubicweb/test/data/libpython/cubicweb_mycube/__pkginfo__.py
cubicweb/test/data/migration/0.1.0_common.py
cubicweb/test/data/migration/0.1.0_repository.py
cubicweb/test/data_schemareader/schema.py
cubicweb/test/data/server_migration/bootstrapmigration_repository.py
cubicweb/test/data/views.py
cubicweb/test/unittest_binary.py
cubicweb/test/unittest_mail.py
cubicweb/test/unittest_repoapi.py
cubicweb/test/unittest_req.py
cubicweb/test/unittest_rtags.py
cubicweb/test/unittest_schema.py
cubicweb/test/unittest_toolsutils.py
cubicweb/web/formwidgets.py
cubicweb/web/test/data/entities.py
cubicweb/web/test/unittest_http_headers.py
cubicweb/web/test/unittest_views_basetemplates.py
cubicweb/web/test/unittest_views_cwsources.py
cubicweb/web/test/unittest_views_json.py
cubicweb/web/views/editcontroller.py
cubicweb/web/views/json.py
cubicweb/web/views/searchrestriction.py
cubicweb/web/views/staticcontrollers.py
cubicweb/web/views/uicfg.py
cubicweb/xy.py
cubicweb/pyramid/auth.py
cubicweb/pyramid/bwcompat.py
cubicweb/pyramid/core.py
cubicweb/pyramid/defaults.py
cubicweb/pyramid/init_instance.py
cubicweb/pyramid/__init__.py
cubicweb/pyramid/login.py
cubicweb/pyramid/predicates.py
cubicweb/pyramid/profile.py
cubicweb/pyramid/resources.py
cubicweb/pyramid/rest_api.py
cubicweb/pyramid/session.py
cubicweb/pyramid/tools.py
cubicweb/pyramid/test/__init__.py
cubicweb/pyramid/test/test_bw_request.py
cubicweb/pyramid/test/test_core.py
cubicweb/pyramid/test/test_login.py
cubicweb/pyramid/test/test_rest_api.py
cubicweb/pyramid/test/test_tools.py
cubicweb/pyramid/pyramidctl.py