diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..f0fdfe6 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,6 @@ +[report] +include = + src/plone/* +omit = + */test* + */upgrades/* diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 3fc34e4..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: plone.formwidget.masterselect CI -on: [push] -jobs: - build: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - python-version: [3.8] - plone-version: [5.2] - - steps: - # git checkout - - uses: actions/checkout@v2 - - # python setup - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 - with: - python-version: ${{ matrix.python-version }} - - # python cache - - uses: actions/cache@v1 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pip- - - # Firefox - - uses: browser-actions/setup-firefox@latest - with: - firefox-version: '102.6.0esr' - - run: firefox --version - - # python install - - run: pip install virtualenv - - run: pip install wheel - - name: pip install - run: pip install -r requirements.txt - - # Xvfb - - run: Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & - - # buildout - - name: buildout - run: buildout -t 10 -c plone-${{ matrix.plone-version }}.x.cfg code-analysis:return-status-codes=True - - # code analysis - - name: code analysis - run: bin/code-analysis - - # test - - name: test - env: - DISPLAY: :99 - run: bin/test diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..9d73b05 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,91 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Push tests +# run-name: ${{ github.actor }} push tests + +on: + push: + pull_request: + +jobs: + test: + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + include: + - python: 3.7.14 + plone: 5.2 + - python: 3.10.11 + plone: "6.0" + - python: 3.13.1 + plone: "6.1" + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set up pyenv and Python + uses: "gabrielfalcao/pyenv-action@v18" + with: + default: "${{ matrix.python }}" + - name: Setup Env + run: | + pip install --upgrade pip + pip install -r requirements-${{ matrix.plone }}.txt + - name: Cache eggs + uses: actions/cache@v4 + env: + cache-name: cache-eggs + with: + path: ~/buildout-cache/eggs + key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ matrix.python }}-${{ matrix.plone }} + - name: buildout + run: | + sed -ie "s#test.cfg#test-${{matrix.plone}}.cfg#" gha.cfg + buildout -c gha.cfg annotate + buildout -c gha.cfg + - name: test + run: | + bin/test -t !robot + coverage: + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + include: + - python: 3.10.11 + plone: "6.0" + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set up pyenv and Python + uses: "gabrielfalcao/pyenv-action@v18" + with: + default: "${{ matrix.python }}" + - name: Setup Env + run: | + pip install --upgrade pip + pip install -r requirements-${{matrix.plone}}.txt + pip install -U coveralls coverage + - name: Cache eggs + uses: actions/cache@v4 + env: + cache-name: cache-eggs + with: + path: ~/buildout-cache/eggs + key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ matrix.python }}-${{ matrix.plone }} + - name: buildout + run: | + sed -ie "s#test.cfg#test-${{matrix.plone}}.cfg#" gha.cfg + buildout -c gha.cfg + - name: code-analysis + run: | + bin/code-analysis + - name: test coverage + run: | + coverage run bin/test -t !robot + - name: Publish to Coveralls + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + coveralls --service=github diff --git a/.gitignore b/.gitignore index 79f3d25..b3706dd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ *.py[co] +.python-version # Packages *.egg @@ -42,3 +43,4 @@ local.cfg /pyvenv.cfg /pip-selfcheck.json +/.plone.versioncheck.tracked.json diff --git a/.isort.cfg b/.isort.cfg new file mode 100644 index 0000000..6f73421 --- /dev/null +++ b/.isort.cfg @@ -0,0 +1,5 @@ +[settings] +force_alphabetical_sort = True +force_single_line = True +lines_after_imports = 2 +line_length = 120 diff --git a/CHANGES.rst b/CHANGES.rst index e4bdf93..89b958c 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,7 +4,8 @@ Changelog 3.0.1 (unreleased) ------------------ -- Nothing changed yet. +- Plone6 compatibility. + [cekk] 3.0.0 (2024-06-05) diff --git a/Makefile b/Makefile index b4de552..8bbec36 100644 --- a/Makefile +++ b/Makefile @@ -1,85 +1,105 @@ -# keep in sync with: https://github.com/kitconcept/buildout/edit/master/Makefile -# update by running 'make update' -SHELL := /bin/bash -CURRENT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) +#!/usr/bin/make +# pyenv is a requirement, with 3.8, 3.10, 3.13 python versions, and virtualenv installed in each version +# plone parameter must be passed to create environment 'make setup plone=6.1' or after a make cleanall +# The original Makefile can be found on https://github.com/IMIO/scripts-buildout + +SHELL=/bin/bash +plones=5.2 6.0 6.1 +b_o= +old_plone=$(shell [ -e .plone-version ] && cat .plone-version) + +ifeq (, $(shell which pyenv)) + $(error "pyenv command not found! Aborting") +endif + +ifndef plone +ifeq (,$(filter setup,$(MAKECMDGOALS))) + plone=$(old_plone) +endif +endif + +ifneq ($(wildcard bin/instance),) + b_o=-N +endif + +ifndef python +ifeq ($(plone),5.2) + python=3.8 +endif +ifeq ($(plone),6.0) + python=3.10 +endif +ifeq ($(plone),6.1) + python=3.13 +endif +endif + +all: buildout -version = 3 - -# We like colors -# From: https://coderwall.com/p/izxssa/colored-makefile-for-golang-projects -RED=`tput setaf 1` -GREEN=`tput setaf 2` -RESET=`tput sgr0` -YELLOW=`tput setaf 3` - -all: .installed.cfg - -# Add the following 'help' target to your Makefile -# And add help text after each target name starting with '\#\#' .PHONY: help -help: ## This help message - @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' +help: + @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n\nTargets:\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-10s\033[0m %s\n", $$1, $$2 }' $(MAKEFILE_LIST) +<<<<<<< HEAD .installed.cfg: bin/buildout *.cfg bin/buildout - -bin/buildout: bin/pip - bin/pip install --upgrade pip - bin/pip install -r requirements.txt - bin/pip install black || true - @touch -c $@ - -bin/python bin/pip: - python$(version) -m venv . || virtualenv --python=python$(version) . - -.PHONY: Build Plone 5.2 -build-plone-5.2: .installed.cfg ## Build Plone 5.2 - bin/pip install --upgrade pip - bin/pip install -r requirements.txt - bin/buildout -c plone-5.2.x.cfg - -.PHONY: Build Plone 5.2 Performance -build-plone-5.2-performance: .installed.cfg ## Build Plone 5.2 - bin/pip install --upgrade pip - bin/pip install -r requirements.txt - bin/buildout -c plone-5.2.x-performance.cfg - -.PHONY: Test -test: ## Test - bin/test - -.PHONY: Test Performance -test-performance: - jmeter -n -t performance.jmx -l jmeter.jtl - -.PHONY: Code Analysis -code-analysis: ## Code Analysis - bin/code-analysis - if [ -f "bin/black" ]; then bin/black src/ --check ; fi - -.PHONY: Black -black: ## Black - bin/code-analysis - if [ -f "bin/black" ]; then bin/black src/ ; fi - -.PHONY: zpretty -zpretty: ## zpretty - if [ -f "bin/zpretty" ]; then zpretty -i ./**/*.zcml; fi - -.PHONY: Build Docs -docs: ## Build Docs - bin/sphinxbuilder - -.PHONY: Test Release -test-release: ## Run Pyroma and Check Manifest - bin/pyroma -n 10 -d . - -.PHONY: Release -release: ## Release - bin/fullrelease - -.PHONY: Clean -clean: ## Clean - git clean -Xdf - -.PHONY: all clean +======= +.python-version: ## Setups pyenv version + @pyenv local `pyenv versions |grep " $(python)" |tail -1 |xargs` + @echo "Local pyenv version is `cat .python-version`" + @ if [[ `pyenv which virtualenv` != `pyenv prefix`* ]] ; then echo "You need to install virtualenv in `cat .python-version` pyenv python (pip install virtualenv)"; exit 1; fi + +bin/buildout: .python-version ## Setups environment + virtualenv . + ./bin/pip install --upgrade pip + ./bin/pip install -r requirements-$(plone).txt + @echo "$(plone)" > .plone-version +>>>>>>> 261a812 (Update buildout to Plone 6.1) + +.PHONY: setup +setup: oneof-plone backup cleanall bin/buildout restore ## Setups environment + +.PHONY: buildout +buildout: oneof-plone bin/buildout ## Runs setup and buildout + rm -f .installed.cfg .mr.developer.cfg + bin/buildout -t 5 -c test-$(plone).cfg ${b_o} + +.PHONY: test +test: oneof-plone bin/buildout ## run bin/test without robot + # can be run by example with: make test opt='-t "settings"' + bin/test -t \!robot ${opt} + +.PHONY: cleanall +cleanall: ## Cleans all installed buildout files + rm -fr bin include lib local share develop-eggs downloads eggs parts .installed.cfg .mr.developer.cfg .python-version pyvenv.cfg + +.PHONY: backup +backup: ## Backups db files + @if [ '$(old_plone)' != '' ] && [ -f var/filestorage/Data.fs ]; then mv var/filestorage/Data.fs var/filestorage/Data.fs.$(old_plone); mv var/blobstorage var/blobstorage.$(old_plone); fi + +.PHONY: restore +restore: ## Restores db files + @if [ '$(plone)' != '' ] && [ -f var/filestorage/Data.fs.$(plone) ]; then mv var/filestorage/Data.fs.$(plone) var/filestorage/Data.fs; mv var/blobstorage.$(plone) var/blobstorage; fi + +.PHONY: which-python +which-python: oneof-plone ## Displays versions information + @echo "current plone = $(old_plone)" + @echo "current python = `cat .python-version`" + @echo "plone var = $(plone)" + @echo "python var = $(python)" + +.PHONY: vcr +vcr: ## Shows requirements in checkversion-r.html + @bin/versioncheck -rbo checkversion-r-$(plone).html test-$(plone).cfg + +.PHONY: vcn +vcn: ## Shows newer packages in checkversion-n.html + @bin/versioncheck -npbo checkversion-n-$(plone).html test-$(plone).cfg + +.PHONY: guard-% +guard-%: + @ if [ "${${*}}" = "" ]; then echo "You must give a value for variable '$*' : like $*=xxx"; exit 1; fi + +.PHONY: oneof-% +oneof-%: + @ if ! echo "${${*}s}" | tr " " '\n' |grep -Fqx "${${*}}"; then echo "Invalid '$*' parameter ('${${*}}') : must be one of '${${*}s}'"; exit 1; fi diff --git a/README.rst b/README.rst index 0193aae..254dca1 100644 --- a/README.rst +++ b/README.rst @@ -1,8 +1,9 @@ -.. image:: https://travis-ci.org/collective/plone.formwidget.masterselect.svg - :target: https://travis-ci.org/collective/plone.formwidget.masterselect +.. image:: https://github.com/collective/plone.formwidget.masterselect/actions/workflows/main.yml/badge.svg + :target: https://github.com/collective/plone.formwidget.masterselect/actions/workflows/main.yml + +.. image:: https://coveralls.io/repos/github/collective/plone.formwidget.masterselect/badge.svg + :target: https://coveralls.io/github/collective/plone.formwidget.masterselect -.. image:: https://coveralls.io/repos/collective/plone.formwidget.masterselect/badge.png - :target: https://coveralls.io/r/collective/plone.formwidget.masterselect MasterSelectWidget ================== @@ -18,7 +19,7 @@ Feel free to help edit this document to help explain things better! Example ======= -For more complex examples see ``demo.py`` in pacakge directory.:: +For more complex examples see ``demo.py`` in package directory.:: from zope import schema from plone.supermodel import model diff --git a/base.cfg b/base.cfg index 0a98034..009c492 100644 --- a/base.cfg +++ b/base.cfg @@ -1,60 +1,83 @@ [buildout] -index = https://pypi.org/simple/ -parts = +package-name = plone.formwidget.masterselect +package-extras = [test] + +extends = + https://raw.githubusercontent.com/collective/buildout.plonetest/master/qa.cfg + checkouts.cfg + +extensions = + mr.developer + plone.versioncheck + +parts += instance - dependencies - code-analysis - test - test-coverage - update-translations - find-untranslated omelette -versions = versions + ploneversioncheck + createcoverage + robot +# coverage +# test-coverage +# plone-helper-scripts + develop = . -[instance] -recipe = plone.recipe.zope2instance -user = admin:admin -http-address = 8080 -eggs = +eggs += Plone Pillow - plone.formwidget.masterselect [test] -zcml = plone.formwidget.masterselect +# Products.PDBDebugMode +# collective.profiler +# ipdb + pdbp +# plone.reload + +package-extras += + pdbp + +always-checkout = force + +[instance] +environment-vars += + PYTHONBREAKPOINT pdbp.set_trace +eggs += + ${buildout:eggs} +zcml += -[dependencies] +[test] +environment = testenv +initialization += + os.environ['PYTHONBREAKPOINT'] = 'pdbp.set_trace' + +[testenv] +zope_i18n_compile_mo_files = true + +[omelette] +recipe = collective.recipe.omelette +eggs = ${test:eggs} + +[ploneversioncheck] recipe = zc.recipe.egg -eggs = - i18ndude - zest.pocompile - zest.releaser[recommended] - zestreleaser.towncrier - towncrier - readme - docutils - coverage - pyroma +eggs = plone.versioncheck [code-analysis] recipe = plone.recipe.codeanalysis -directory = ${buildout:directory}/src/plone -flake8-max-line-length = 88 -flake8-exclude=docs,bin,*.egg,setup.py,overrides -flake8-max-complexity = 20 -flake8-ignore = E501, W503 +pre-commit-hook = True +return-status-codes = True +directory = ${buildout:directory}/src/plone/formwidget/masterselect +flake8-ignore = E123,E124,E501,E126,E127,E128,W391,C901,W503,W504 flake8-extensions = - flake8-debugger - flake8-print -# additional pep8/flake8 rules, see docs for details -# https://pep8.readthedocs.io/en/1.4.6/intro.html#error-codes -# - E123: closing bracket does not match indentation of opening bracket’s line -# flake8-select = E123 + flake8-isort -[test] -recipe = collective.xmltestreport -eggs = ${instance:eggs} -defaults = ['-s', 'plone.formwidget.masterselect', '--auto-color', '--auto-progress'] -environment = environment +[robot] +recipe = zc.recipe.egg +eggs = + Pillow + ${test:eggs} + plone.app.robotframework[reload, debug] + +[coverage] +recipe = zc.recipe.egg +eggs = coverage [test-coverage] recipe = collective.recipe.template @@ -69,44 +92,12 @@ input = inline: output = ${buildout:directory}/bin/test-coverage mode = 755 -[environment] -ROBOT_SELENIUM2LIBRARY_RUN_ON_FAILURE = Capture page screenshot and log source - -[update-translations] -recipe = collective.recipe.template -input = inline: - domain=plone.formwidget.masterselect - maindir=src/plone/formwidget/masterselect - locales=$maindir/locales - echo "Update translations for $domain" - if [ ! -f $locales/$domain.pot ]; then - # Create .pot file if it does not exist yet - touch $locales/$domain.pot - fi - if [ ! -f $locales/de/LC_MESSAGES ]; then - # Create de/LC_MESSAGES directory if it does not exist yet - mkdir -p $locales/de/LC_MESSAGES - fi - if [ ! -f $locales/de/LC_MESSAGES/$domain.po ]; then - # Create .po file if it does not exist yet - touch $locales/de/LC_MESSAGES/$domain.po - fi - ${buildout:directory}/bin/i18ndude rebuild-pot --pot $locales/$domain.pot --create $domain $maindir - ${buildout:directory}/bin/i18ndude sync --pot $locales/$domain.pot $locales/*/LC_MESSAGES/$domain.po -output = ${buildout:directory}/bin/updatetranslations -mode = 755 - -[find-untranslated] -recipe = collective.recipe.template -input = inline: - #!/bin/sh - bin/i18ndude find-untranslated `find -L src/plone/formwidget/masterselect -regex ".*\.[cz]?pt"` -output = ${buildout:directory}/bin/find-untranslated -mode = 755 - -[omelette] -recipe = collective.recipe.omelette -eggs = ${test:eggs} - -[versions] -plone.formwidget.masterselect = \ No newline at end of file +[plone-helper-scripts] +recipe = zc.recipe.egg +eggs = + Products.CMFPlone + ${instance:eggs} +interpreter = zopepy +scripts = + zopepy + plone-compile-resources diff --git a/checkouts.cfg b/checkouts.cfg new file mode 100644 index 0000000..b2d77a4 --- /dev/null +++ b/checkouts.cfg @@ -0,0 +1,13 @@ +[buildout] +always-checkout = force +auto-checkout += + +[remotes] +plone = https://github.com/plone +plone_push = git@github.com:plone +zopefoundation = https://github.com/zopefoundation +zopefoundation_push = git@github.com:zopefoundation +col = https://github.com/collective +col_push = git@github.com:collective + +[sources] diff --git a/ci.cfg b/ci.cfg deleted file mode 100644 index af1a4f2..0000000 --- a/ci.cfg +++ /dev/null @@ -1,7 +0,0 @@ -[buildout] -extends = plone-x.x.x.cfg - -[code-analysis] -recipe = plone.recipe.codeanalysis -pre-commit-hook = False -return-status-codes = True diff --git a/gha.cfg b/gha.cfg new file mode 100644 index 0000000..ef2e218 --- /dev/null +++ b/gha.cfg @@ -0,0 +1,5 @@ +[buildout] +extends = + test.cfg +eggs-directory = ~/buildout-cache/eggs +download-cache = ~/buildout-cache/downloads diff --git a/plone-5.2.x.cfg b/plone-5.2.x.cfg deleted file mode 100644 index dbc7af7..0000000 --- a/plone-5.2.x.cfg +++ /dev/null @@ -1,4 +0,0 @@ -[buildout] -extends = - https://dist.plone.org/release/5.2.14/versions.cfg - base.cfg diff --git a/requirements-5.2.txt b/requirements-5.2.txt index 37660fa..65fbf37 100644 --- a/requirements-5.2.txt +++ b/requirements-5.2.txt @@ -1 +1,4 @@ --r https://dist.plone.org/release/5.2.14/requirements.txt +-c https://dist.plone.org/release/5.2-latest/requirements.txt +setuptools +zc.buildout +wheel diff --git a/requirements-6.0.txt b/requirements-6.0.txt new file mode 100644 index 0000000..75ae54c --- /dev/null +++ b/requirements-6.0.txt @@ -0,0 +1,3 @@ +-c https://dist.plone.org/release/6.0-latest/requirements.txt +setuptools +zc.buildout diff --git a/requirements-6.1.txt b/requirements-6.1.txt new file mode 100644 index 0000000..aaf0495 --- /dev/null +++ b/requirements-6.1.txt @@ -0,0 +1,3 @@ +-c https://dist.plone.org/release/6.1-latest/requirements.txt +setuptools +zc.buildout diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 05fc900..0000000 --- a/requirements.txt +++ /dev/null @@ -1 +0,0 @@ --r requirements-5.2.txt diff --git a/setup.py b/setup.py index e4a2580..d50a61a 100644 --- a/setup.py +++ b/setup.py @@ -4,60 +4,71 @@ from setuptools import setup -version = '3.0.1.dev0' +version = "3.0.1.dev0" -long_description = '\n\n'.join([ - open('README.rst').read(), - open('CONTRIBUTORS.rst').read(), - open('CHANGES.rst').read(), -]) +long_description = "\n\n".join( + [ + open("README.rst").read(), + open("CONTRIBUTORS.rst").read(), + open("CHANGES.rst").read(), + ] +) setup( - name='plone.formwidget.masterselect', + name="plone.formwidget.masterselect", version=version, - description='A z3c.form widget that controls the vocabulary or ' - 'display of other fields on an edit page', + description="A z3c.form widget that controls the vocabulary or " + "display of other fields on an edit page", long_description=long_description, classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Web Environment', - 'Framework :: Plone', - 'Framework :: Plone :: 5.2', - 'Intended Audience :: End Users/Desktop', - 'License :: OSI Approved :: GNU General Public License (GPL)', - 'Operating System :: OS Independent', - 'Programming Language :: JavaScript', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3.8', - 'Topic :: Software Development :: Libraries :: Python Modules', - 'Topic :: Software Development :: Widget Sets', + "Development Status :: 5 - Production/Stable", + "Environment :: Web Environment", + "Framework :: Plone", + "Framework :: Plone :: 5.2", + "Framework :: Plone :: 6.0", + "Framework :: Plone :: 6.1", + "Programming Language :: Python", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Intended Audience :: End Users/Desktop", + "License :: OSI Approved :: GNU General Public License (GPL)", + "Operating System :: OS Independent", + "Programming Language :: JavaScript", + "Programming Language :: Python", + "Programming Language :: Python :: 3.8", + "Topic :: Software Development :: Libraries :: Python Modules", + "Topic :: Software Development :: Widget Sets", ], - keywords='plone widget', - author='Jason Mehring', - author_email='nrgaway@yahoo.com', - url='https://github.com/collective/plone.formwidget.masterselect', - license='GPL', - packages=find_packages("src", exclude=['ez_setup']), - namespace_packages=['plone', 'plone.formwidget'], + keywords="plone widget", + author="Jason Mehring", + author_email="nrgaway@yahoo.com", + url="https://github.com/collective/plone.formwidget.masterselect", + license="GPL", + packages=find_packages("src", exclude=["ez_setup"]), + namespace_packages=["plone", "plone.formwidget"], package_dir={"": "src"}, include_package_data=True, zip_safe=False, install_requires=[ - 'plone.supermodel', - 'plone.z3cform', - 'Products.CMFPlone', - 'setuptools', - 'z3c.form', - 'zope.component', - 'zope.schema', + "plone.supermodel", + "plone.z3cform", + "Products.CMFPlone", + "setuptools", + "z3c.form", + "zope.component", + "zope.schema", ], extras_require={ - 'test': [ - 'plone.app.dexterity', - 'plone.app.robotframework', - 'plone.app.testing [robot] >= 4.2.2', - 'plone.registry', - 'Products.GenericSetup', + "test": [ + "plone.app.dexterity", + "plone.app.robotframework", + "plone.app.testing [robot] >= 4.2.2", + "plone.registry", + "Products.GenericSetup", ], }, entry_points=""" diff --git a/src/plone/formwidget/masterselect/__init__.py b/src/plone/formwidget/masterselect/__init__.py index f54a08f..98effce 100644 --- a/src/plone/formwidget/masterselect/__init__.py +++ b/src/plone/formwidget/masterselect/__init__.py @@ -1,14 +1,10 @@ from plone.formwidget.masterselect.interfaces import IMasterSelectBoolField from plone.formwidget.masterselect.interfaces import IMasterSelectField from plone.formwidget.masterselect.interfaces import IMasterSelectRadioField -from plone.formwidget.masterselect.widget import \ - MasterSelectBoolFieldWidget # noqa: F401 -from plone.formwidget.masterselect.widget import \ - MasterSelectFieldWidget # noqa: F401 -from plone.formwidget.masterselect.widget import \ - MasterSelectRadioFieldWidget # noqa: F401 -from plone.formwidget.masterselect.widget import \ - MasterSelectWidget # noqa: F401 +from plone.formwidget.masterselect.widget import MasterSelectBoolFieldWidget # noqa: F401 +from plone.formwidget.masterselect.widget import MasterSelectFieldWidget # noqa: F401 +from plone.formwidget.masterselect.widget import MasterSelectRadioFieldWidget # noqa: F401 +from plone.formwidget.masterselect.widget import MasterSelectWidget # noqa: F401 from zope.i18nmessageid import MessageFactory from zope.interface import implementer from zope.schema import Bool @@ -24,6 +20,7 @@ class MasterSelectField(Choice): """MasterSelectField that provides additional properties for widget (extends schema.Choice) """ + slave_fields = () def __init__(self, slave_fields=(), **kw): @@ -36,6 +33,7 @@ class MasterSelectBoolField(Bool): """MasterSelectBoolField that provides addtional properties for widget (extends schema.Bool) """ + slave_fields = () def __init__(self, slave_fields=(), **kw): @@ -48,6 +46,7 @@ class MasterSelectRadioField(Choice): """MasterSelectRadioField that provides additional properties for widget (extends schema.Choice) """ + slave_fields = () def __init__(self, slave_fields=(), **kw): diff --git a/src/plone/formwidget/masterselect/configure.zcml b/src/plone/formwidget/masterselect/configure.zcml index 9b5c8b3..a094700 100644 --- a/src/plone/formwidget/masterselect/configure.zcml +++ b/src/plone/formwidget/masterselect/configure.zcml @@ -4,10 +4,12 @@ xmlns:z3c="http://namespaces.zope.org/z3c" xmlns:plone="http://namespaces.plone.org/plone" xmlns:gs="http://namespaces.zope.org/genericsetup" + xmlns:zcml="http://namespaces.zope.org/zcml" i18n_domain="plone.formwidget.masterselect"> + @@ -27,26 +29,55 @@ directory="static" /> - + + + + + + + + + + + + + + + + + - - + +