This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

This package provides support to write local site and utilities for Zope directly in Python (without ZCML).

Setting up grokcore.site

This package is essentially set up like the grokcore.component package, please refer to its documentation for details. The only additional ZCML line you will need is:

<include package="grokcore.site" />

Put this somewhere near the top of your root ZCML file but below the line where you include grokcore.component’s configuration.

Examples

Global utilities are already managed by grokcore.component.

Here a simple example of a local utility:

from zope.interface import implements, Interface
import grokcore.site

class IKangaroo(Interface):

    def jump():
       """Make all kangaroos jump somewhere.
       """

class KangarooUtility(grokcore.site.LocalUtility):
    implements(IKangaroo)

    def jump(self):
        pass

Now, we can register our utility to a local site. That will create automatically, and register that utility when we create that site:

class Jungle(grokcore.site.Site):

    grokcore.site.local_utility(KangarooUtility, IKangaroo)

If you don’t add the last line, you will still have your site, but nothing to make jump your kangaroo. Then, you will be able to add manually by hand after (if you want).

API Overview

Base classes

Site
Base class for your site.
LocalUtility
Base class for a ZODB-persitent local utility.

Directives

local_utility(factory, provides=None, name=u'', setup=None, public=False, name_in_container=None)

Directive used on a site to register a local utility at the creation time:

factory
Would be the component to register (required parameter),
provides
Would be the interface used to query the local utility (required parameter),
name
Would be the name used to query the local utility,
setup
Would be a function taking parameter. If defined it will be called after the utility is created with it as first and unique parameter.
public
If true, the utility will be created in the site container itself, not in the site manager, and public will be able to access it directly.
name_in_container
Would be used as id for the utility in container itwill be created. If not defined it will ask NameChooser to pick a name for it.

In addition, the grokcore.site package exposes the grokcore.component API.

Changes

1.8 (2016-09-21)

  • When removing a site make sure reference are removed from the parent site.

1.7.1 (2016-01-29)

  • Update tests.

1.7 (2015-06-11)

  • Add a new directive install_on that is usable on a site. This directive let you customize when (namely the event) to install the configured local sites.
  • Rename ApplicationInitializedEvent to ApplicationAddedEvent.
  • When the IApplicationAddedEvent is triggered the new application will be current Zope local site. The site is restored after the event.

1.6.1 (2012-05-02)

  • Exposed ApplicationInitializedEvent and IApplicationInitializedEvent.
  • Added the missing import for the exposed IApplication interface.

1.6 (2012-05-01)

  • Moved the directive \(site\) from Grok to this package.
  • Moved the component \(Application\) and all the related utilities from Grok to this package.

1.5 (2011-01-03)

  • Moved IApplication and getApplication from the Grok package into this one.

1.4 (2010-11-01)

  • Upped versions requirements for martian and grokcore.component.

1.3 (2010-10-18)

  • Made package comply to repository policy.
  • Update functional tests to only use zope.app.appsetup instead of zope.app.testing.
  • Update functional tests not to require zope.app.zcmlfiles anymore.

1.2 (2009-12-20)

  • Migrated imports from zope.app.component to zope.site.

1.1 (2009-09-18)

  • Updated dependencies (added missing ones and added separate test dependencies).
  • A local utility now implements IAttributeAnnotatable.
  • Update code documentation from Grok itself.
  • Use 1.0b2 versions.cfg in Grok’s release info instead of a local copy; a local copy for all grokcore packages is just too hard to maintain.

1.0.1 (2009-06-30)

  • Reupload to pypi with a correct version of Python which doesn’t have a distutils bug.

1.0 (2009-06-29)

  • Created grokcore.site by factoring local site based components, grokkers and directives out of Grok.
Release History

Release History

1.8

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.7.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.7

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.6.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.6

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.5

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.4

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
grokcore.site-1.8.tar.gz (20.6 kB) Copy SHA256 Checksum SHA256 Source Sep 21, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting