[Zope3-checkins] CVS: zopeproducts/demo/utility - __init__.py:1.1 code.py:1.1 configure.zcml:1.1 interfaces.py:1.1

Guido van Rossum guido@python.org
Mon, 17 Mar 2003 11:20:55 -0500


Update of /cvs-repository/zopeproducts/demo/utility
In directory cvs.zope.org:/tmp/cvs-serv24126/utility

Added Files:
	__init__.py code.py configure.zcml interfaces.py 
Log Message:
Demo utility -- we'll fix this ASAP.

=== Added File zopeproducts/demo/utility/__init__.py ===



=== Added File zopeproducts/demo/utility/code.py ===
from interfaces import IDemoUtility

class DemoUtility:

    __implements__ = IDemoUtility

    def greet(self):
        return "hello world"


=== Added File zopeproducts/demo/utility/configure.zcml ===
<zopeConfigure
  xmlns="http://namespaces.zope.org/zope"
  xmlns:browser="http://namespaces.zope.org/browser"
>

  <content
    class="demo.utility.code.DemoUtility">

    <factory
      id="demo.utility.DemoUtility"
      permission="zope.ManageServices"
      />

    <implements
      interface="zope.app.interfaces.services.utility.ILocalUtility" />

    <implements
      interface="zope.app.interfaces.annotation.IAttributeAnnotatable" />

    <require
      permission="zope.View"
      interface="demo.utility.interfaces.IDemoUtility"
      />

  </content>

  <browser:menuItem
      for="zope.app.interfaces.container.IAdding"
      menu="add_component"
      action="demo.utility.DemoUtility"
      title="Demo Utility"
      description="a greeting utility"
      permission="zope.ManageServices"
      />

</zopeConfigure>


=== Added File zopeproducts/demo/utility/interfaces.py ===
from zope.interface import Interface

class IDemoUtility(Interface):

    def greet(): """Return a string."""