Local commands:
==============

    >>> rmdir(tempdir, 'plone.example')
    >>> cd(tempdir)

Check that the `addcontent` command is not globaly available::

    >>> help_text = read_sh('paster help')
    >>> help_text.find('addcontent') == -1
    True

`addcontent` is active for all ZopeSkel templates that inherit from
BaseTemplate except those which are not eggs (ie: plone3_buildout).
Let's for example take the basic_namespace template::

    >>> paster('create -t basic_namespace plone.example --no-interactive')
    paster create -t basic_namespace plone.example --no-interactive
    ...
    >>> p_dir = os.path.join(tempdir, 'plone.example')
    >>> cd(p_dir)
    >>> paster('help')
    paster help
    ...
    <BLANKLINE>
    ZopeSkel local commands:
      addcontent   Adds plone content types to your project
    <BLANKLINE>
    <BLANKLINE>

Let's see what sub-templates are avaiblable for this kind of projects::

    >>> paster('addcontent --list')
    paster addcontent --list
    Available templates:
        No template
    <BLANKLINE>

OK for the basic_namespace based project there is no sub-template available.
Let's create an archetype project::

    >>> rmdir(tempdir, 'plone.example')
    >>> cd(tempdir)
    >>> paster('create -t archetype plone.example --no-interactive')
    paster create -t archetype plone.example --no-interactive
    ...
    >>> p_dir = os.path.join(tempdir, 'plone.example')
    >>> cd(p_dir)
    >>> paster('help')
    paster help
    ...
    <BLANKLINE>
    ZopeSkel local commands:
      addcontent   Adds plone content types to your project
    <BLANKLINE>
    <BLANKLINE>

What sub-templates are available for an archetype based project ?::

    >>> paster('addcontent --list')
    paster addcontent --list
    Available templates:
      atschema:     A handy AT schema builder
      contenttype:  A content type skeleton
      portlet:      A Plone 3 portlet
      view:         A browser view skeleton
      zcmlmeta:     A ZCML meta directive skeleton

Now we can add a portlet to our project::

    >>> paster('addcontent --no-interactive portlet')
    paster addcontent --no-interactive portlet
    Recursing into portlets
    ...

Test if we have the new files::

    >>> ls(p_dir, 'plone', 'ploneexample', 'portlets')
    __init__.py
    configure.zcml
    exampleportlet.pt
    exampleportlet.py
    >>> ls(p_dir, 'plone', 'ploneexample', 'tests')
    __init__.py
    base_exampleportlet.py
    doc_tests.py
    test_exampleportlet.py

Check that the existing files like profile/portlets are updated::

    >>> cat(p_dir, 'plone', 'ploneexample', 'profiles', 'default', 'portlets.xml')
    <?xml version="1.0"?>
    ...
       <portlet
         addview="plone.ploneexample.portlets.ExamplePortlet"
         title="Example portlet"
         description=""
       />
    ...


