Jeff Kowalczyk wrote:
Phillip, thanks for releasing mkzopeapp. I recently got started with a
buildout-enabled zope-3 project by imitating the layout of z3c.formdemo.

How would I use mkzopeapp to create a project.package name like
z3c.formdemo, or is this not generally recommended for application

Currently mkzopeapp doesn't support the creation of namespaced packages out of the box, but it's really easy to do this manually (see below).

  $ mkzopeapp AcmeSite
  Selected and implied templates:
    mkzopeapp#zope_app  Package that contains a Zope application
    egg:      AcmeSite
    package:  acmesite
    project:  AcmeSite
  Creating template zope_app
  Creating directory ./AcmeSite
    Recursing into +package+
      Creating ./AcmeSite/acmesite/
      Copying to ./AcmeSite/acmesite/
      Copying configure.zcml_tmpl to ./AcmeSite/acmesite/configure.zcml
      Copying develop.ini to ./AcmeSite/acmesite/develop.ini
      Copying main.py_tmpl to ./AcmeSite/acmesite/
      Recursing into var
        Creating ./AcmeSite/acmesite/var/
        Copying README.txt to ./AcmeSite/acmesite/var/README.txt
    Copying setup.py_tmpl to ./AcmeSite/
  Running /usr/bin/python egg_info

To convert the 'acmesite' package into a package called 'jeff.acmesite', simply do:

  $ cd AcmeSite
  $ mkdir jeff
  $ mv acmesite jeff

Then create jeff/

  # this is a namespace package
      import pkg_resources
  except ImportError:
      import pkgutil
      __path__ = pkgutil.extend_path(__path__, __name__)

Then edit and add the following parameter:



-- -- Professional Zope documentation and training

Zope3-users mailing list

Reply via email to