plone / bobtemplates.plone

Python Code Templates for Plone Projects with mr.bob
https://pypi.org/project/bobtemplates.plone/
GNU General Public License v2.0
24 stars 31 forks source link

create content_type 'dict object' has no attribute 'is_plone5' #459

Closed agitator closed 3 years ago

agitator commented 3 years ago

created new user, fresh venv from os python

(buildout.coredev) marvin@hope Desktop % mkdir playground
(buildout.coredev) marvin@hope Desktop % cd playground 
(buildout.coredev) marvin@hope playground % /usr/bin/python3 -m venv .
(buildout.coredev) marvin@hope playground % source ./bin/activate
(playground) marvin@hope playground % pip install plonecli
Collecting plonecli
  Using cached https://files.pythonhosted.org/packages/b5/8b/12eecc72d0b3362e59cba381b1b94987bf1cfd9dd5d0159690dda6186aa7/plonecli-2.0.tar.gz
Requirement already satisfied: setuptools in ./lib/python3.8/site-packages (from plonecli) (41.2.0)
Collecting virtualenv (from plonecli)
  Using cached https://files.pythonhosted.org/packages/91/fb/ca6c071f4231e06a9f0c3bd81c15c233bbacd4a7d9dbb7438d95fece8a1e/virtualenv-20.4.3-py2.py3-none-any.whl
Collecting Click>=7.0 (from plonecli)
  Using cached https://files.pythonhosted.org/packages/d2/3d/fa76db83bf75c4f8d338c2fd15c8d33fdd7ad23a9b5e57eb6c5de26b430e/click-7.1.2-py2.py3-none-any.whl
Collecting click-aliases (from plonecli)
  Using cached https://files.pythonhosted.org/packages/7f/2f/ef20be7d95d305218c9ecdb40b03b5d3286c50de374970e3a9c7790dd6d5/click_aliases-1.0.1-py2.py3-none-any.whl
Collecting mr.bob (from plonecli)
  Using cached https://files.pythonhosted.org/packages/23/fe/25d78b8e9c84ac177fc3edae0186b842d0a788f19710c250b08a23fdb528/mr.bob-0.1.2.tar.gz
Collecting zest.releaser (from plonecli)
  Using cached https://files.pythonhosted.org/packages/16/4a/59676a7b470ec96735f5fc09f45f5390e2c882d5405132be2d2568b73003/zest.releaser-6.22.1-py2.py3-none-any.whl
Collecting bobtemplates.plone>=5.2.0 (from plonecli)
  Using cached https://files.pythonhosted.org/packages/f2/60/ca00f769a478615092b4981a49e01483cbc05df6b43b21e34a43b953cbbd/bobtemplates.plone-5.2.0.tar.gz
Collecting six<2,>=1.9.0 (from virtualenv->plonecli)
  Using cached https://files.pythonhosted.org/packages/ee/ff/48bde5c0f013094d729fe4b0316ba2a24774b3ff1c52d924a8a4cb04078a/six-1.15.0-py2.py3-none-any.whl
Collecting distlib<1,>=0.3.1 (from virtualenv->plonecli)
  Using cached https://files.pythonhosted.org/packages/f5/0a/490fa011d699bb5a5f3a0cf57de82237f52a6db9d40f33c53b2736c9a1f9/distlib-0.3.1-py2.py3-none-any.whl
Collecting filelock<4,>=3.0.0 (from virtualenv->plonecli)
  Using cached https://files.pythonhosted.org/packages/93/83/71a2ee6158bb9f39a90c0dea1637f81d5eef866e188e1971a1b1ab01a35a/filelock-3.0.12-py3-none-any.whl
Collecting appdirs<2,>=1.4.3 (from virtualenv->plonecli)
  Using cached https://files.pythonhosted.org/packages/3b/00/2344469e2084fb287c2e0b57b72910309874c3245463acd6cf5e3db69324/appdirs-1.4.4-py2.py3-none-any.whl
Collecting Jinja2>=2.5.0 (from mr.bob->plonecli)
  Using cached https://files.pythonhosted.org/packages/7e/c2/1eece8c95ddbc9b1aeb64f5783a9e07a286de42191b7204d67b7496ddf35/Jinja2-2.11.3-py2.py3-none-any.whl
Collecting colorama (from zest.releaser->plonecli)
  Using cached https://files.pythonhosted.org/packages/44/98/5b86278fbbf250d239ae0ecb724f8572af1c91f4a11edf4d36a206189440/colorama-0.4.4-py2.py3-none-any.whl
Collecting twine>=1.6.0 (from zest.releaser->plonecli)
  Using cached https://files.pythonhosted.org/packages/42/ad/713372978a8de58a43c507bf62b9c30c3d7b5cda4e972d563b881620a511/twine-3.4.1-py3-none-any.whl
Collecting requests (from zest.releaser->plonecli)
  Using cached https://files.pythonhosted.org/packages/29/c1/24814557f1d22c56d50280771a17307e6bf87b70727d975fd6b2ce6b014a/requests-2.25.1-py2.py3-none-any.whl
Collecting lxml (from bobtemplates.plone>=5.2.0->plonecli)
  Downloading https://files.pythonhosted.org/packages/e5/21/a2e4517e3d216f0051687eea3d3317557bde68736f038a3b105ac3809247/lxml-4.6.3.tar.gz (3.2MB)
     |████████████████████████████████| 3.2MB 4.8MB/s 
Collecting case-conversion (from bobtemplates.plone>=5.2.0->plonecli)
  Using cached https://files.pythonhosted.org/packages/cb/8c/14731e4d4f6fd9876575abc7df9861bcb0a21d764f7ac622ab5485c45afe/case_conversion-2.1.0.tar.gz
Collecting tox (from bobtemplates.plone>=5.2.0->plonecli)
  Using cached https://files.pythonhosted.org/packages/ec/7e/4609fd0386d41f0b94fe952708970fb87cc1fb66e088758b1f0ab336802e/tox-3.23.0-py2.py3-none-any.whl
Collecting isort (from bobtemplates.plone>=5.2.0->plonecli)
  Using cached https://files.pythonhosted.org/packages/d9/47/0ec3ec948b7b3a0ba44e62adede4dca8b5985ba6aaee59998bed0916bd17/isort-5.8.0-py3-none-any.whl
Collecting MarkupSafe>=0.23 (from Jinja2>=2.5.0->mr.bob->plonecli)
  Downloading https://files.pythonhosted.org/packages/b9/2e/64db92e53b86efccfaea71321f597fa2e1b2bd3853d8ce658568f7a13094/MarkupSafe-1.1.1.tar.gz
Collecting importlib-metadata>=3.6 (from twine>=1.6.0->zest.releaser->plonecli)
  Using cached https://files.pythonhosted.org/packages/80/5d/0bbca82b16e01313cf0343167d4cfb90f6fade747cd4d10d368094b2883a/importlib_metadata-3.7.3-py3-none-any.whl
Collecting keyring>=15.1 (from twine>=1.6.0->zest.releaser->plonecli)
  Using cached https://files.pythonhosted.org/packages/26/f9/41230ac47f738f1ba66676dc8d3b30ca5b1f9eb0230fc204bcd9836c4ae9/keyring-23.0.1-py3-none-any.whl
Collecting requests-toolbelt!=0.9.0,>=0.8.0 (from twine>=1.6.0->zest.releaser->plonecli)
  Using cached https://files.pythonhosted.org/packages/60/ef/7681134338fc097acef8d9b2f8abe0458e4d87559c689a8c306d0957ece5/requests_toolbelt-0.9.1-py2.py3-none-any.whl
Collecting pkginfo>=1.4.2 (from twine>=1.6.0->zest.releaser->plonecli)
  Using cached https://files.pythonhosted.org/packages/b0/9a/d78e7c299eb5659bc3a036e5a968a399c62bfe0b2aa18baf7d13f43373ba/pkginfo-1.7.0-py2.py3-none-any.whl
Collecting tqdm>=4.14 (from twine>=1.6.0->zest.releaser->plonecli)
  Using cached https://files.pythonhosted.org/packages/f8/3e/2730d0effc282960dbff3cf91599ad0d8f3faedc8e75720fdf224b31ab24/tqdm-4.59.0-py2.py3-none-any.whl
Collecting readme-renderer>=21.0 (from twine>=1.6.0->zest.releaser->plonecli)
  Using cached https://files.pythonhosted.org/packages/39/a5/459adfa22ea237f6e8d0fa95ad29d7369579a5eec26f016ab34bb7f8359c/readme_renderer-29.0-py2.py3-none-any.whl
Collecting rfc3986>=1.4.0 (from twine>=1.6.0->zest.releaser->plonecli)
  Using cached https://files.pythonhosted.org/packages/78/be/7b8b99fd74ff5684225f50dd0e865393d2265656ef3b4ba9eaaaffe622b8/rfc3986-1.4.0-py2.py3-none-any.whl
Collecting idna<3,>=2.5 (from requests->zest.releaser->plonecli)
  Using cached https://files.pythonhosted.org/packages/a2/38/928ddce2273eaa564f6f50de919327bf3a00f091b5baba8dfa9460f3a8a8/idna-2.10-py2.py3-none-any.whl
Collecting certifi>=2017.4.17 (from requests->zest.releaser->plonecli)
  Using cached https://files.pythonhosted.org/packages/5e/a0/5f06e1e1d463903cf0c0eebeb751791119ed7a4b3737fdc9a77f1cdfb51f/certifi-2020.12.5-py2.py3-none-any.whl
Collecting urllib3<1.27,>=1.21.1 (from requests->zest.releaser->plonecli)
  Using cached https://files.pythonhosted.org/packages/09/c6/d3e3abe5b4f4f16cf0dfc9240ab7ce10c2baa0e268989a4e3ec19e90c84e/urllib3-1.26.4-py2.py3-none-any.whl
Collecting chardet<5,>=3.0.2 (from requests->zest.releaser->plonecli)
  Using cached https://files.pythonhosted.org/packages/19/c7/fa589626997dd07bd87d9269342ccb74b1720384a4d739a1872bd84fbe68/chardet-4.0.0-py2.py3-none-any.whl
Collecting regex>=2016.2.25 (from case-conversion->bobtemplates.plone>=5.2.0->plonecli)
  Downloading https://files.pythonhosted.org/packages/84/cb/e7792d2c52f61a686ce0fabe79b3674c41238d07cd35c79b4062e9a807f6/regex-2021.3.17.tar.gz (694kB)
     |████████████████████████████████| 696kB 21.0MB/s 
Collecting py>=1.4.17 (from tox->bobtemplates.plone>=5.2.0->plonecli)
  Using cached https://files.pythonhosted.org/packages/67/32/6fe01cfc3d1a27c92fdbcdfc3f67856da8cbadf0dd9f2e18055202b2dc62/py-1.10.0-py2.py3-none-any.whl
Collecting pluggy>=0.12.0 (from tox->bobtemplates.plone>=5.2.0->plonecli)
  Using cached https://files.pythonhosted.org/packages/a0/28/85c7aa31b80d150b772fbe4a229487bc6644da9ccb7e427dd8cc60cb8a62/pluggy-0.13.1-py2.py3-none-any.whl
Collecting packaging>=14 (from tox->bobtemplates.plone>=5.2.0->plonecli)
  Using cached https://files.pythonhosted.org/packages/3e/89/7ea760b4daa42653ece2380531c90f64788d979110a2ab51049d92f408af/packaging-20.9-py2.py3-none-any.whl
Collecting toml>=0.9.4 (from tox->bobtemplates.plone>=5.2.0->plonecli)
  Using cached https://files.pythonhosted.org/packages/44/6f/7120676b6d73228c96e17f1f794d8ab046fc910d781c8d151120c3f1569e/toml-0.10.2-py2.py3-none-any.whl
Collecting zipp>=0.5 (from importlib-metadata>=3.6->twine>=1.6.0->zest.releaser->plonecli)
  Using cached https://files.pythonhosted.org/packages/0f/8c/715c54e9e34c0c4820f616a913a7de3337d0cd79074dd1bed4dd840f16ae/zipp-3.4.1-py3-none-any.whl
Collecting bleach>=2.1.0 (from readme-renderer>=21.0->twine>=1.6.0->zest.releaser->plonecli)
  Using cached https://files.pythonhosted.org/packages/f0/46/2bbd92086a4c6f051214cb48df6d9132b5f32c5e881d3f4991b16ec7e499/bleach-3.3.0-py2.py3-none-any.whl
Collecting docutils>=0.13.1 (from readme-renderer>=21.0->twine>=1.6.0->zest.releaser->plonecli)
  Using cached https://files.pythonhosted.org/packages/81/44/8a15e45ffa96e6cf82956dd8d7af9e666357e16b0d93b253903475ee947f/docutils-0.16-py2.py3-none-any.whl
Collecting Pygments>=2.5.1 (from readme-renderer>=21.0->twine>=1.6.0->zest.releaser->plonecli)
  Using cached https://files.pythonhosted.org/packages/3a/80/a52c0a7c5939737c6dca75a831e89658ecb6f590fb7752ac777d221937b9/Pygments-2.8.1-py3-none-any.whl
Collecting pyparsing>=2.0.2 (from packaging>=14->tox->bobtemplates.plone>=5.2.0->plonecli)
  Using cached https://files.pythonhosted.org/packages/8a/bb/488841f56197b13700afd5658fc279a2025a39e22449b7cf29864669b15d/pyparsing-2.4.7-py2.py3-none-any.whl
Collecting webencodings (from bleach>=2.1.0->readme-renderer>=21.0->twine>=1.6.0->zest.releaser->plonecli)
  Using cached https://files.pythonhosted.org/packages/f4/24/2a3e3df732393fed8b3ebf2ec078f05546de641fe1b667ee316ec1dcf3b7/webencodings-0.5.1-py2.py3-none-any.whl
Installing collected packages: six, distlib, filelock, appdirs, virtualenv, Click, click-aliases, MarkupSafe, Jinja2, mr.bob, colorama, zipp, importlib-metadata, keyring, idna, certifi, urllib3, chardet, requests, requests-toolbelt, pkginfo, tqdm, webencodings, pyparsing, packaging, bleach, docutils, Pygments, readme-renderer, rfc3986, twine, zest.releaser, lxml, regex, case-conversion, py, pluggy, toml, tox, isort, bobtemplates.plone, plonecli
  Running setup.py install for MarkupSafe ... done
  Running setup.py install for mr.bob ... done
  Running setup.py install for lxml ... done
  Running setup.py install for regex ... done
  Running setup.py install for case-conversion ... done
  Running setup.py install for bobtemplates.plone ... done
  Running setup.py install for plonecli ... done
Successfully installed Click-7.1.2 Jinja2-2.11.3 MarkupSafe-1.1.1 Pygments-2.8.1 appdirs-1.4.4 bleach-3.3.0 bobtemplates.plone-5.2.0 case-conversion-2.1.0 certifi-2020.12.5 chardet-4.0.0 click-aliases-1.0.1 colorama-0.4.4 distlib-0.3.1 docutils-0.16 filelock-3.0.12 idna-2.10 importlib-metadata-3.7.3 isort-5.8.0 keyring-23.0.1 lxml-4.6.3 mr.bob-0.1.2 packaging-20.9 pkginfo-1.7.0 plonecli-2.0 pluggy-0.13.1 py-1.10.0 pyparsing-2.4.7 readme-renderer-29.0 regex-2021.3.17 requests-2.25.1 requests-toolbelt-0.9.1 rfc3986-1.4.0 six-1.15.0 toml-0.10.2 tox-3.23.0 tqdm-4.59.0 twine-3.4.1 urllib3-1.26.4 virtualenv-20.4.3 webencodings-0.5.1 zest.releaser-6.22.1 zipp-3.4.1
WARNING: You are using pip version 19.2.3, however version 21.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
(playground) marvin@hope playground % plonecli create addon hello.site

RUN: mrbob bobtemplates.plone:addon -O hello.site

Welcome to mr.bob interactive mode. Before we generate directory structure, some questions need to be answered.

Answer with a question mark to display help.
Values in square brackets at the end of the questions show the default value if there is no answer.

--> Author's name [FakeGitUserOrEmail]: 

--> Author's email [FakeGitUserOrEmail]: 

--> Author's GitHub username: 

--> Package description [An add-on for Plone]: 

--> Do you want me to initialze a GIT repository in your new package? (y/n) [y]: 

--> Plone version [5.2.1]: 

--> Python version for virtualenv [python3.7]: 

--> Do you want me to activate VS Code support? (y/n) [y]: 

isort-apply: successful:
isort-apply create: /Users/marvin/Desktop/playground/hello.site/.tox/isort-apply
isort-apply installdeps: isort<5
isort-apply installed: appdirs==1.4.4,bleach==3.3.0,bobtemplates.plone==5.2.0,case-conversion==2.1.0,certifi==2020.12.5,chardet==4.0.0,click==7.1.2,click-aliases==1.0.1,colorama==0.4.4,distlib==0.3.1,docutils==0.16,filelock==3.0.12,idna==2.10,importlib-metadata==3.7.3,isort==5.8.0,Jinja2==2.11.3,keyring==23.0.1,lxml==4.6.3,MarkupSafe==1.1.1,mr.bob==0.1.2,packaging==20.9,pkginfo==1.7.0,plonecli==2.0,pluggy==0.13.1,py==1.10.0,Pygments==2.8.1,pyparsing==2.4.7,readme-renderer==29.0,regex==2021.3.17,requests==2.25.1,requests-toolbelt==0.9.1,rfc3986==1.4.0,six==1.15.0,toml==0.10.2,tox==3.23.0,tqdm==4.59.0,twine==3.4.1,urllib3==1.26.4,virtualenv==20.4.3,webencodings==0.5.1,zest.releaser==6.22.1,zipp==3.4.1
isort-apply run-test-pre: PYTHONHASHSEED='3708346809'
isort-apply run-test: commands[0] | isort --recursive --apply /Users/marvin/Desktop/playground/hello.site/src
Fixing /Users/marvin/Desktop/playground/hello.site/src/hello/site/tests/test_setup.py
___________________________________ summary ____________________________________
  isort-apply: commands succeeded
  congratulations :)

RUN: git init
b'Initialized empty Git repository in /Users/marvin/Desktop/playground/hello.site/.git/\n'
Should we run?:
git add .
git commit -m "Create addon: hello.site"
in: /Users/marvin/Desktop/playground/hello.site
[y]/n: 
RUN: git add .
RUN: git commit -m "Create addon: hello.site"

*** Please tell me who you are.

Run

  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'marvin@hope.(none)')
b''
Generated file structure at /Users/marvin/Desktop/playground/hello.site/hello.site

(playground) marvin@hope playground % cd hello.site 
(playground) marvin@hope hello.site % plonecli create content_type greeting

RUN: mrbob bobtemplates.plone:content_type -O greeting

Welcome to mr.bob interactive mode. Before we generate directory structure, some questions need to be answered.

Answer with a question mark to display help.
Values in square brackets at the end of the questions show the default value if there is no answer.

RUN: git status --porcelain --ignore-submodules
git status result:
----------------------------
b'A  .coveragerc\nA  .editorconfig\nA  .gitattributes\nA  .gitignore\nA  .gitlab-ci.yml\nA  .travis.yml\nA  CHANGES.rst\nA  CONTRIBUTORS.rst\nA  DEVELOP.rst\nA  LICENSE.GPL\nA  LICENSE.rst\nA  MANIFEST.in\nA  README.rst\nA  base.cfg\nA  bobtemplate.cfg\nA  buildout.cfg\nA  constraints.txt\nA  constraints_plone43.txt\nA  constraints_plone50.txt\nA  constraints_plone51.txt\nA  constraints_plone52.txt\nA  docs/conf.py\nA  docs/index.rst\nA  requirements.txt\nA  setup.cfg\nA  setup.py\nA  src/hello/__init__.py\nA  src/hello/site/__init__.py\nA  src/hello/site/browser/__init__.py\nA  src/hello/site/browser/configure.zcml\nA  src/hello/site/browser/overrides/.gitkeep\nA  src/hello/site/browser/static/.gitkeep\nA  src/hello/site/configure.zcml\nA  src/hello/site/interfaces.py\nA  src/hello/site/locales/README.rst\nA  src/hello/site/locales/__init__.py\nA  src/hello/site/locales/en/LC_MESSAGES/hello.site.po\nA  src/hello/site/locales/hello.site.pot\nA  src/hello/site/locales/update.py\nA  src/hello/site/locales/update.sh\nA  src/hello/site/permissions.zcml\nA  src/hello/site/profiles/default/browserlayer.xml\nA  src/hello/site/profiles/default/catalog.xml\nA  src/hello/site/profiles/default/metadata.xml\nA  src/hello/site/profiles/default/registry/main.xml\nA  src/hello/site/profiles/default/rolemap.xml\nA  src/hello/site/profiles/uninstall/browserlayer.xml\nA  src/hello/site/setuphandlers.py\nA  src/hello/site/testing.py\nA  src/hello/site/tests/__init__.py\nA  src/hello/site/tests/robot/test_example.robot\nA  src/hello/site/tests/test_robot.py\nA  src/hello/site/tests/test_setup.py\nA  test_plone43.cfg\nA  test_plone50.cfg\nA  test_plone51.cfg\nA  test_plone52.cfg\nA  tox.ini\n'
--> Please commit your changes, before using a sub-template! Continue anyway? [n/y] [n]: y

--> Content type name (Allowed: _ a-z A-Z and whitespace) [Todo Task]: Servus

--> Content type description: 

--> Use XML Model [y]: 

--> Dexterity base class (Container/Item) [Container]: 

--> Should the content type globally addable? [y]: 

--> Should we filter content types to be added to this container? [n]: 

--> Activate default behaviors? [y]: 

Traceback (most recent call last):
  File "/Users/marvin/Desktop/playground/bin/mrbob", line 11, in <module>
    load_entry_point('mr.bob==0.1.2', 'console_scripts', 'mrbob')()
  File "/Users/marvin/Desktop/playground/lib/python3.8/site-packages/mrbob/cli.py", line 175, in main
    c.render()
  File "/Users/marvin/Desktop/playground/lib/python3.8/site-packages/mrbob/configurator.py", line 186, in render
    render_structure(self.template_dir,
  File "/Users/marvin/Desktop/playground/lib/python3.8/site-packages/mrbob/rendering.py", line 77, in render_structure
    render_template(
  File "/Users/marvin/Desktop/playground/lib/python3.8/site-packages/mrbob/rendering.py", line 102, in render_template
    output = renderer(source_output, variables)
  File "/Users/marvin/Desktop/playground/lib/python3.8/site-packages/mrbob/rendering.py", line 22, in <lambda>
    jinja2_renderer = lambda s, v: jinja2_env.from_string(s).render(parse_variables(v))
  File "/Users/marvin/Desktop/playground/lib/python3.8/site-packages/jinja2/environment.py", line 1090, in render
    self.environment.handle_exception()
  File "/Users/marvin/Desktop/playground/lib/python3.8/site-packages/jinja2/environment.py", line 832, in handle_exception
    reraise(*rewrite_traceback_stack(source=source))
  File "/Users/marvin/Desktop/playground/lib/python3.8/site-packages/jinja2/_compat.py", line 28, in reraise
    raise value.with_traceback(tb)
  File "<template>", line 17, in top-level template code
jinja2.exceptions.UndefinedError: 'dict object' has no attribute 'is_plone5'
(playground) marvin@hope hello.site % 
jensens commented 3 years ago

Same here on Ubuntu if following these steps.

jensens commented 3 years ago

if I put a conditional debugger in mrbob/rendering.py like so:

def render_template(fs_source, fs_target_dir, variables, verbose, renderer):
    filename = path.split(fs_source)[1]
    if filename.endswith('.bob'):
        filename = filename.split('.bob')[0]
        fs_target_path = path.join(fs_target_dir, render_filename(filename, variables))
        if verbose:
            print(six.u("Rendering %s to %s") % (fs_source, fs_target_path))
        fs_source_mode = stat.S_IMODE(os.stat(fs_source).st_mode)
        with codecs.open(fs_source, 'r', 'utf-8') as f:
            source_output = f.read()
            try:
                output = renderer(source_output, variables)
            except Exception as e:
                breakpoint()
            # append newline due to jinja2 bug, see https://github.com/iElectric/mr.bob/issues/30
            if source_output.endswith('\n') and not output.endswith('\n'):

the I find it happens while genratig the FTI. The current variables are like so:

{'dexterity_parent_container_type_name': None,
 'dexterity_type_activate_default_behaviors': True,
 'dexterity_type_base_class': 'Container',
 'dexterity_type_create_class': None,
 'dexterity_type_desc': '',
 'dexterity_type_filter_content_types': False,
 'dexterity_type_fti_file_name': 'Todo_Task',
 'dexterity_type_global_allow': True,
 'dexterity_type_name': 'Todo Task',
 'dexterity_type_name_klass': 'TodoTask',
 'dexterity_type_name_normalized': 'todo_task',
 'dexterity_type_supermodel': True,
 'package.dottedname': 'hello.site',
 'package.name': 'site',
 'package.namespace': 'hello',
 'package.root_folder': '/home/jensens/ws/sandbox/hello.site',
 'package.uppercasename': 'HELLO_SITE',
 'package_folder': '/home/jensens/ws/sandbox/hello.site/src/hello/site',
 'package_folder_rel_path': '/src/hello/site',
 'plone.version': None,
 'subtemplate_warning': None,
 'template_id': 'content_type',
 'year': 2021}

Confusing, no idea whats going on there.

erral commented 3 years ago

The point is that you are doing plonecli create content_type greeting and you should be doing plonecli add content_type greeting

plonecli create works for top-level templates, and plonecli add should be used for subtemplates

jensens commented 3 years ago

This is indeed true! So the bug here is, bobtemplates does not cry out loud if impossible parameters are given. Better validation seems the key.

MrTango commented 3 years ago

i just fixed a bug with the version reading and setting these vars, this might be also have been a problem. I'll close this issue for now, feel fre to open it when this is still a problem.