<configure
    xmlns="http://namespaces.zope.org/zope"
    xmlns:browser="http://namespaces.zope.org/browser"
    i18n_domain="zope">

  <interface
      interface=".interfaces.IPythonScript"
      type="zope.app.content.interfaces.IContentType"
      />

  <class class=".script.PythonScript">
      <factory
        id="cybertools.pyscript.PythonScript"
        title="Python Page"
        description="A simple, content-based Python Script"
        />
    <require
        permission="zope.View"
        interface=".interfaces.IPythonScript"
        />
    <require
        permission="zope.ManageContent"
        set_attributes="title parameters source contentType"
        />
    <implements
        interface="zope.annotation.interfaces.IAttributeAnnotatable"
        />
  </class>


  <!-- browser directives -->

  <browser:page
      name="index.html"
      for=".interfaces.IPythonScript"
      class=".browser.PythonScriptEval"
      attribute="index"
      permission="zope.View"
      />

  <browser:addform
      label="Add Python Script"
      name="AddPythonScript.html"
      schema=".interfaces.IPythonScript"
      content_factory=".script.PythonScript"
      permission="zope.ManageContent"
      />

  <browser:addMenuItem
      class=".script.PythonScript"
      title="Python Script"
      description="An Python Script"
      permission="zope.ManageContent"
      view="AddPythonScript.html"
      />

  <browser:editform
      for=".interfaces.IPythonScript"
      schema=".interfaces.IPythonScript"
      name="edit.html"
      label="Edit Python Script"
      class=".browser.PythonScriptEditView"
      template="edit.pt"
      permission="zope.ManageContent"
      menu="zmi_views" title="Edit"
      />


  <!-- Preview view - requires zope.app.preview -->

  <configure package="zope.app.preview">
    <browser:page
        for="cybertools.pyscript.interfaces.IPythonScript"
        name="preview.html"
        template="preview.pt"
        permission="zope.ManageContent"
        menu="zmi_views" title="Preview"
        />
  </configure>

</configure>
