{"id":31782398,"url":"https://github.com/zopefoundation/z3c.zcmlhook","last_synced_at":"2025-10-10T09:20:06.461Z","repository":{"id":46966428,"uuid":"213378447","full_name":"zopefoundation/z3c.zcmlhook","owner":"zopefoundation","description":"This package provides means of hooking into the Zope (ZCML) configuration process.","archived":false,"fork":false,"pushed_at":"2025-04-14T06:18:37.000Z","size":34,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":77,"default_branch":"master","last_synced_at":"2025-04-14T07:27:31.487Z","etag":null,"topics":["maintained","python","zcml","zope"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zopefoundation.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-10-07T12:33:54.000Z","updated_at":"2025-04-14T06:18:38.000Z","dependencies_parsed_at":"2025-03-27T08:35:00.238Z","dependency_job_id":null,"html_url":"https://github.com/zopefoundation/z3c.zcmlhook","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/zopefoundation/z3c.zcmlhook","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zopefoundation%2Fz3c.zcmlhook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zopefoundation%2Fz3c.zcmlhook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zopefoundation%2Fz3c.zcmlhook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zopefoundation%2Fz3c.zcmlhook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zopefoundation","download_url":"https://codeload.github.com/zopefoundation/z3c.zcmlhook/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zopefoundation%2Fz3c.zcmlhook/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279003410,"owners_count":26083581,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["maintained","python","zcml","zope"],"created_at":"2025-10-10T09:20:05.190Z","updated_at":"2025-10-10T09:20:06.453Z","avatar_url":"https://github.com/zopefoundation.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Introduction\n============\n\nThis package provides means of hooking into the Zope (ZCML) configuration\nprocess.\n\nCustom ZCML actions\n-------------------\n\nIt is sometimes useful to execute a function during the execution of \nconfiguration actions, for example to perform one-off configuration that does\nnot warrant a new directive. The ``\u003czcml:customAction /\u003e`` directive is\nprovided for this purpose.\n\nFor example, you may want to call a function called\n``my.package.finalConfiguration()`` \"late\" in the configuration action\nexecution cycle. This can be achieved with the following ZCML statements::\n\n    \u003cconfigure\n        xmlns=\"http://namespaces.zope.org/zope\"\n        xmlns:zcml=\"http://namespaces.zope.org/zcml\"\n        i18n_domain=\"my.package\"\u003e\n        \n        \u003cinclude package=\"z3c.zcmlhook\" file=\"meta.zcml\" /\u003e\n        \n        \u003czcml:customAction\n            handler=\"my.package.finalConfiguration\"\n            order=\"9999\"\n            /\u003e\n        \n    \u003c/configure\u003e\n\nThe ``handler`` attribute gives the name of a function to execute. The\nfunction should take no arguments. The ``order`` attribute is optional, and\ncan be used to influence when in the configuration cycle the function is\nexecuted. The default value for this, as for most Zope configuration actions,\nis ``0``.\n\nOverriding custom actions\n-------------------------\n\nIf you want to override the invocation of a custom handler in an\n``overrides.zcml``, you need to tell ``zope.configuration`` which handler to\noverride. You can do that by setting the *discriminator* explicitly. A\ndiscriminator is used to uniquely identify a configuration action. In the\ncase of the ``\u003czcml:customAction /\u003e`` directive, the discriminator is based\non the full dotted name to the function by default. Thus, you could override\nthe function call above like so::\n\n        \u003czcml:customAction\n            handler=\"my.otherpackage.overrideFinalConfiguration\"\n            discriminator=\"my.package.finalConfiguration\"\n            order=\"9999\"\n            /\u003e\n\nUsing a handler more than once\n------------------------------\n\nThe ``discriminator`` attribute can also be used to explicitly allow using\nthe same handler more than once. If you wanted to call\n``my.package.finalConfiguration`` again, you would normally get a\nconfiguration conflict. However, with a (unique) custom discriminator, the\nsecond call is allowed::\n\n        \u003czcml:customAction\n            handler=\"my.package.finalConfiguration\"\n            discriminator=\"my.package.finalConfiguration:early\"\n            order=\"-9999\"\n            /\u003e\n\n        \u003czcml:customAction\n            handler=\"my.package.finalConfiguration\"\n            discriminator=\"my.package.finalConfiguration:late\"\n            order=\"9999\"\n            /\u003e\n\nHere, we are attempting to call our configuration action \"very early\" as\nwell as \"very late\" in the configuration process.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzopefoundation%2Fz3c.zcmlhook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzopefoundation%2Fz3c.zcmlhook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzopefoundation%2Fz3c.zcmlhook/lists"}