Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install megrok.strictrequire

How to install megrok.strictrequire

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install megrok.strictrequire
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.5 Available View build log
0.4 Available View build log
0.3 Available View build log
Windows (64-bit)
0.5 Available View build log
0.4 Available View build log
0.3 Available View build log
Mac OS X (10.5+)
0.5 Available View build log
0.4 Available View build log
0.3 Available View build log
Linux (32-bit)
0.5 Available View build log
0.4 Available View build log
0.3 Available View build log
Linux (64-bit)
0.5 Available View build log
0.4 Available View build log
0.3 Available View build log
 
License
ZPL 2.1
Lastest release
version 0.5 on Jul 20th, 2011

megrok.strictrequire

What is megrok.strictrequire?

Strictrequire implements additional grokkers for the various view components in Grok. These grokkers determine whether the grok.require directive has been explicitly set on the view component (or on its baseclass).

It will raise an error (and thus prevent the startup of the application) if there's a view component without an explicit use of the grok.require directive, providing a minimal safety net for finding unprotected views in your application.

Making use of megrok.strictrequire

To enable megrok.strictrequire simply list it as a requirement in your projects's setup.py. Grok based applications that were bootstrapped with a recent version of the grokproject command will automatically include the megrok.strictrequire's configure.zcml making the additional grokkers effective.

Caveat

If your applications triggers the registration of "third-party" views that do not themselves specifically use the grok.require directive, your application will not start.

If you decide you still want to make use of the third-aprty views you should make sure the inclusion of the configure.zcml of megrok.strictrequire comes after the inclusion of the third-party package by tweaking your applications's configure.zcml. For example:

<configure xmlns="http://namespaces.zope.org/zope"
           xmlns:grok="http://namespaces.zope.org/grok">
  <include package="grok" />

  <!-- include this package before mgrok.strictrequire is included -->
  <include package="package_with_unprotected_views" />

  <!-- includeDependencies will include megrok.strictrequire -->
  <includeDependencies package="." />
  <grok:grok package="." />
</configure>

Changelog of megrok.strictrequire

0.5 (2011-07-19)
  • Reflect recent changes in grok 1.8.
0.4 (2011-07-11)
  • Use the groktoolkit versions.
  • Don't check the requirement directive for ViewletManager, as these are not exposed as views.
0.3 (2010-05-18)
  • Test-requirements have been fixed. They formally include zope.app.testing for the moment.
0.2 (2009-06-22)
  • Check ViewletManager and Viewlet components too.
0.1 (2009-06-18)
  • Initial release.

Subscribe to package updates

Last updated Jul 20th, 2011

Download Stats

Last month:3

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.