Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move directive schemas and handlers of elementary directives (adapter…
…, subscriber, utility) to zope.component.zcml. Tests aren't moved yet (and BBB isn't provided either)
- Loading branch information
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
############################################################################## | ||
# | ||
# Copyright (c) 2004 Zope Corporation and Contributors. | ||
# All Rights Reserved. | ||
# | ||
# This software is subject to the provisions of the Zope Public License, | ||
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. | ||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED | ||
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS | ||
# FOR A PARTICULAR PURPOSE. | ||
# | ||
############################################################################## | ||
"""This module handles the 'apidoc' namespace directives. | ||
$Id: metaconfigure.py 26889 2004-08-04 04:00:36Z pruggera $ | ||
""" | ||
__docformat__ = 'restructuredtext' | ||
from zope.interface import implements | ||
from zope.component.zcml import utility | ||
|
||
from zope.app.apidoc import classregistry | ||
from zope.app.apidoc.codemodule.interfaces import IAPIDocRootModule | ||
|
||
|
||
class RootModule(str): | ||
implements(IAPIDocRootModule) | ||
|
||
def rootModule(_context, module): | ||
"""Register a new module as a root module for the class browser.""" | ||
utility(_context, IAPIDocRootModule, RootModule(module), name=module) | ||
|
||
|
||
def setModuleImport(flag): | ||
classregistry.__import_unknown_modules__ = flag | ||
|
||
def moduleImport(_context, allow): | ||
"""Set the __import_unknown_modules__ flag""" | ||
return _context.action( | ||
('apidoc', '__import_unknown_modules__'), | ||
setModuleImport, | ||
(allow, )) |