Skip to main content

This package allows you to register browser menus and menu items for browser views in Grok.

A menu is easily registered by creating a subclass of megrok.menu.Menu:

import megrok.menu.Menu

class Tabs(megrok.menu.Menu):
    grok.name('tabs')
    grok.title('Tabs')
    grok.description('')

A view can then placed on a menu with the menuitem directive:

class Edit(grok.View):
    grok.title('Edit')
    grok.description("Change this object's data.")
    megrok.menu.menuitem('tabs')

    ...

The title and description directives used here specifie the menu item’s label and description. The menuitem directive takes at least one argument, the menu that the item is registered to be for. This can either be an identifier string or the menu class itself. Other optional parameters include icon, filter, order and extra.

For more use cases and examples, take a look to tests/test_functional.py

Changelog

0.4.1 (2016-02-16)

  • Update tests.

0.4 (2010-03-06)

  • Cleaned the tests module. Now, we only use the ZTK packages to test.

  • The dependencies have been cleared. We no longer depend on zope.app packages.

  • Updated the security grokking in the menu items grokker. We don’t need the protect_getattr, as the view security grokker already does it for us.

  • Fixed the dependencies in the package requires. All dependencies are now clearly declared.

  • Added a LICENSE.txt file for the ZPL 2.1.

0.3 (2009-11-02)

  • Added the support of the grokcore.viewlet ‘order’ directive to reorder the menu items and sub menus. This permits to have a baseclass defining the basic menu and to keep the ordering possibility in the sublasses. We probably should do that for the different arguments of the menuitem directive. That would allow more genericity and reusability. Note : this change is 100% backward compatible. Simply added tests to show the behavior. [trollfot]

  • Get rid of the grok dependency. Now depends only on grokcore.* packages

  • Updated the build process

0.2 (2009-03-02)

  • Compatible with grok1.0a1

  • Add the SubMenuItem base class and it’s grokker SubMenuItemGrokker

  • Add the extra parameter to the menuitem directive

  • Tests for added functionality

  • Remove version.cfg

0.1 (2008-07-12)

Initial release.

Metadata

Release files for megrok.menu 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for megrok.menu 0.4.1
File Size Uploaded Provenance
megrok.menu-0.4.1.tar.gz 11.2 kB Without provenance Details

Release files / megrok.menu-0.4.1.tar.gz

Download URL megrok.menu-0.4.1.tar.gz
Size 11.2 kB
Tags Source
SHA-256 checksum
How to use checksums
111fabaa0fccf88096cd33ab7cd5e1b336c35cbf1d7598a3348ad5fb1831519e
BLAKE2b-256 checksum
How to use checksums
25fb1ea562fe4be5be37b07e24c52e057e60fd99b035d3133275920ab8063d2b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for megrok.menu 0.4.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page