collective.behavior.internalnumber 0.2__tar.gz → 0.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/CHANGES.rst +13 -0
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/Makefile +13 -5
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/PKG-INFO +17 -2
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/setup.py +6 -3
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/src/collective/behavior/internalnumber/adapters.py +6 -1
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/src/collective/behavior/internalnumber/browser/configure.zcml +1 -0
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/src/collective/behavior/internalnumber/browser/settings.py +5 -5
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/src/collective/behavior/internalnumber/configure.zcml +11 -1
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/src/collective/behavior/internalnumber/profiles/default/catalog.xml +0 -1
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/src/collective/behavior/internalnumber/profiles/default/metadata.xml +1 -1
- collective.behavior.internalnumber-0.4/src/collective/behavior/internalnumber/profiles/uninstall/catalog.xml +4 -0
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/src/collective/behavior/internalnumber/tests/test_behavior.py +5 -1
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/src/collective/behavior/internalnumber/tests/test_settings.py +1 -3
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/src/collective/behavior/internalnumber/tests/test_setup.py +14 -0
- collective.behavior.internalnumber-0.4/src/collective/behavior/internalnumber/upgrades.py +10 -0
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/src/collective.behavior.internalnumber.egg-info/PKG-INFO +17 -2
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/src/collective.behavior.internalnumber.egg-info/SOURCES.txt +2 -0
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/src/collective.behavior.internalnumber.egg-info/requires.txt +0 -1
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/CONTRIBUTORS.rst +0 -0
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/MANIFEST.in +0 -0
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/README.rst +0 -0
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/docs/LICENSE.GPL +0 -0
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/docs/LICENSE.rst +0 -0
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/docs/index.rst +0 -0
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/requirements-4.3.txt +0 -0
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/requirements-5.2.txt +0 -0
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/requirements-6.0.txt +0 -0
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/setup.cfg +0 -0
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/src/collective/__init__.py +0 -0
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/src/collective/behavior/__init__.py +0 -0
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/src/collective/behavior/internalnumber/__init__.py +0 -0
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/src/collective/behavior/internalnumber/behavior.py +0 -0
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/src/collective/behavior/internalnumber/browser/__init__.py +0 -0
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/src/collective/behavior/internalnumber/browser/static/.gitkeep +0 -0
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/src/collective/behavior/internalnumber/interfaces.py +0 -0
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/src/collective/behavior/internalnumber/locales/collective.behavior.internalnumber.pot +0 -0
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/src/collective/behavior/internalnumber/locales/fr/LC_MESSAGES/collective.behavior.internalnumber.po +0 -0
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/src/collective/behavior/internalnumber/locales/update.sh +0 -0
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/src/collective/behavior/internalnumber/profiles/default/browserlayer.xml +0 -0
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/src/collective/behavior/internalnumber/profiles/default/controlpanel.xml +0 -0
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/src/collective/behavior/internalnumber/profiles/default/registry.xml +0 -0
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/src/collective/behavior/internalnumber/profiles/testing/metadata.xml +0 -0
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/src/collective/behavior/internalnumber/profiles/testing/types/testtype.xml +0 -0
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/src/collective/behavior/internalnumber/profiles/testing/types.xml +0 -0
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/src/collective/behavior/internalnumber/profiles/uninstall/browserlayer.xml +0 -0
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/src/collective/behavior/internalnumber/setuphandlers.py +0 -0
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/src/collective/behavior/internalnumber/subscribers.py +0 -0
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/src/collective/behavior/internalnumber/testing.py +0 -0
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/src/collective/behavior/internalnumber/testing.zcml +0 -0
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/src/collective/behavior/internalnumber/tests/__init__.py +0 -0
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/src/collective/behavior/internalnumber/tests/robot/test_example.robot +0 -0
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/src/collective/behavior/internalnumber/tests/test_robot.py +0 -0
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/src/collective/behavior/internalnumber/tests/test_subscribers.py +0 -0
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/src/collective.behavior.internalnumber.egg-info/dependency_links.txt +0 -0
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/src/collective.behavior.internalnumber.egg-info/entry_points.txt +0 -0
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/src/collective.behavior.internalnumber.egg-info/namespace_packages.txt +0 -0
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/src/collective.behavior.internalnumber.egg-info/not-zip-safe +0 -0
- {collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/src/collective.behavior.internalnumber.egg-info/top_level.txt +0 -0
{collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/CHANGES.rst
RENAMED
|
@@ -2,6 +2,19 @@ Changelog
|
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
4
|
|
|
5
|
+
0.4 (2024-06-07)
|
|
6
|
+
----------------
|
|
7
|
+
|
|
8
|
+
- Use `fti.Title()` that is a i18n `Message` instance to manage settings
|
|
9
|
+
`portal_types` vocabulary. Also sort vocabulary by term title.
|
|
10
|
+
[gbastien]
|
|
11
|
+
|
|
12
|
+
0.3 (2023-11-27)
|
|
13
|
+
----------------
|
|
14
|
+
|
|
15
|
+
- Removed catalog metadata `internal_number`, added upgrade step to 1001.
|
|
16
|
+
[gbastien]
|
|
17
|
+
|
|
5
18
|
0.2 (2023-05-31)
|
|
6
19
|
----------------
|
|
7
20
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/make
|
|
2
2
|
# pyenv is a requirement, with 2.7, 3.7 and 3.10 python versions, and virtualenv installed in each version
|
|
3
|
-
# plone parameter must be passed to create environment or after a make cleanall
|
|
3
|
+
# plone parameter must be passed to create environment 'make setup plone=6.0' or after a make cleanall
|
|
4
|
+
# The original Makefile can be found on https://github.com/IMIO/scripts-buildout
|
|
4
5
|
|
|
5
6
|
SHELL=/bin/bash
|
|
6
7
|
plones=4.3 5.2 6.0
|
|
@@ -12,9 +13,11 @@ ifeq (, $(shell which pyenv))
|
|
|
12
13
|
endif
|
|
13
14
|
|
|
14
15
|
ifndef plone
|
|
16
|
+
ifeq (,$(filter setup,$(MAKECMDGOALS)))
|
|
15
17
|
plone=$(old_plone)
|
|
16
18
|
b_o=-N
|
|
17
19
|
endif
|
|
20
|
+
endif
|
|
18
21
|
|
|
19
22
|
ifndef python
|
|
20
23
|
ifeq ($(plone),4.3)
|
|
@@ -35,7 +38,7 @@ help:
|
|
|
35
38
|
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n\nTargets:\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-10s\033[0m %s\n", $$1, $$2 }' $(MAKEFILE_LIST)
|
|
36
39
|
|
|
37
40
|
.python-version: ## Setups pyenv version
|
|
38
|
-
@pyenv local `pyenv versions |grep " $(python)" |xargs`
|
|
41
|
+
@pyenv local `pyenv versions |grep " $(python)" |tail -1 |xargs`
|
|
39
42
|
@echo "Local pyenv version is `cat .python-version`"
|
|
40
43
|
@ 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
|
|
41
44
|
|
|
@@ -53,17 +56,22 @@ buildout: oneof-plone bin/buildout ## Runs setup and buildout
|
|
|
53
56
|
rm -f .installed.cfg .mr.developer.cfg
|
|
54
57
|
bin/buildout -t 5 -c test-$(plone).cfg ${b_o}
|
|
55
58
|
|
|
59
|
+
.PHONY: test
|
|
60
|
+
test: oneof-plone bin/buildout ## run bin/test without robot
|
|
61
|
+
# can be run by example with: make test opt='-t "settings"'
|
|
62
|
+
bin/test -t \!robot ${opt}
|
|
63
|
+
|
|
56
64
|
.PHONY: cleanall
|
|
57
65
|
cleanall: ## Cleans all installed buildout files
|
|
58
|
-
rm -fr bin include lib local share develop-eggs downloads eggs parts .installed.cfg .mr.developer.cfg .python-version
|
|
66
|
+
rm -fr bin include lib local share develop-eggs downloads eggs parts .installed.cfg .mr.developer.cfg .python-version pyvenv.cfg
|
|
59
67
|
|
|
60
68
|
.PHONY: backup
|
|
61
69
|
backup: ## Backups db files
|
|
62
|
-
@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
|
|
70
|
+
@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
|
|
63
71
|
|
|
64
72
|
.PHONY: restore
|
|
65
73
|
restore: ## Restores db files
|
|
66
|
-
@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
|
|
74
|
+
@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
|
|
67
75
|
|
|
68
76
|
.PHONY: which-python
|
|
69
77
|
which-python: oneof-plone ## Displays versions information
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: collective.behavior.internalnumber
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4
|
|
4
4
|
Summary: Configurable internal number plone behavior
|
|
5
|
-
Home-page:
|
|
5
|
+
Home-page: UNKNOWN
|
|
6
6
|
Author: Stephan Geulette
|
|
7
7
|
Author-email: support@imio.be
|
|
8
8
|
License: GPL version 2
|
|
9
|
+
Project-URL: Source, https://github.com/collective/collective.behavior.internalnumber
|
|
10
|
+
Project-URL: PyPI, https://pypi.python.org/pypi/collective.behavior.internalnumber
|
|
9
11
|
Description: .. This README is meant for consumption by humans and pypi. Pypi can render rst files so please do not use Sphinx features.
|
|
10
12
|
If you want to learn more about writing documentation, please check out: http://docs.plone.org/about/documentation_styleguide.html
|
|
11
13
|
This text does not appear on pypi or github. It is a comment.
|
|
@@ -100,6 +102,19 @@ Description: .. This README is meant for consumption by humans and pypi. Pypi ca
|
|
|
100
102
|
=========
|
|
101
103
|
|
|
102
104
|
|
|
105
|
+
0.4 (2024-06-07)
|
|
106
|
+
----------------
|
|
107
|
+
|
|
108
|
+
- Use `fti.Title()` that is a i18n `Message` instance to manage settings
|
|
109
|
+
`portal_types` vocabulary. Also sort vocabulary by term title.
|
|
110
|
+
[gbastien]
|
|
111
|
+
|
|
112
|
+
0.3 (2023-11-27)
|
|
113
|
+
----------------
|
|
114
|
+
|
|
115
|
+
- Removed catalog metadata `internal_number`, added upgrade step to 1001.
|
|
116
|
+
[gbastien]
|
|
117
|
+
|
|
103
118
|
0.2 (2023-05-31)
|
|
104
119
|
----------------
|
|
105
120
|
|
|
@@ -14,7 +14,7 @@ long_description = '\n\n'.join([
|
|
|
14
14
|
|
|
15
15
|
setup(
|
|
16
16
|
name='collective.behavior.internalnumber',
|
|
17
|
-
version='0.
|
|
17
|
+
version='0.4',
|
|
18
18
|
description="Configurable internal number plone behavior",
|
|
19
19
|
long_description=long_description,
|
|
20
20
|
# Get more from https://pypi.python.org/pypi?%3Aaction=list_classifiers
|
|
@@ -36,7 +36,11 @@ setup(
|
|
|
36
36
|
keywords='Python Plone',
|
|
37
37
|
author='Stephan Geulette',
|
|
38
38
|
author_email='support@imio.be',
|
|
39
|
-
url='https://pypi.python.org/pypi/collective.behavior.internalnumber',
|
|
39
|
+
# url='https://pypi.python.org/pypi/collective.behavior.internalnumber',
|
|
40
|
+
project_urls={
|
|
41
|
+
"PyPI": "https://pypi.python.org/pypi/collective.behavior.internalnumber",
|
|
42
|
+
"Source": "https://github.com/collective/collective.behavior.internalnumber",
|
|
43
|
+
},
|
|
40
44
|
license='GPL version 2',
|
|
41
45
|
packages=find_packages('src', exclude=['ez_setup']),
|
|
42
46
|
namespace_packages=['collective', 'collective.behavior'],
|
|
@@ -48,7 +52,6 @@ setup(
|
|
|
48
52
|
'Products.GenericSetup>=1.8.2',
|
|
49
53
|
'setuptools',
|
|
50
54
|
'collective.behavior.talcondition',
|
|
51
|
-
'collective.dexteritytextindexer',
|
|
52
55
|
'collective.z3cform.datagridfield',
|
|
53
56
|
],
|
|
54
57
|
extras_require={
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
2
|
|
|
3
|
+
from collective.behavior.internalnumber import PLONE_VERSION
|
|
3
4
|
from collective.behavior.internalnumber.behavior import IInternalNumberBehavior
|
|
4
|
-
from collective.dexteritytextindexer.interfaces import IDynamicTextIndexExtender
|
|
5
5
|
from plone.indexer import indexer
|
|
6
6
|
from Products.CMFCore.interfaces import IContentish
|
|
7
7
|
from Products.CMFPlone.utils import base_hasattr
|
|
@@ -15,6 +15,11 @@ try:
|
|
|
15
15
|
except ImportError:
|
|
16
16
|
from Products.PluginIndexes.unindex import _marker as common_marker # noqa
|
|
17
17
|
|
|
18
|
+
if PLONE_VERSION < '6.0':
|
|
19
|
+
from collective.dexteritytextindexer.interfaces import IDynamicTextIndexExtender
|
|
20
|
+
else:
|
|
21
|
+
from plone.app.dexterity.textindexer.interfaces import IDynamicTextIndexExtender
|
|
22
|
+
|
|
18
23
|
|
|
19
24
|
@indexer(IContentish)
|
|
20
25
|
def internal_number_index(obj):
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
directory="static"
|
|
12
12
|
/>
|
|
13
13
|
<include zcml:condition="installed plone.app.controlpanel" package="plone.app.controlpanel" file="permissions.zcml" />
|
|
14
|
+
<include zcml:condition="have plone-60" package="Products.CMFPlone.controlpanel" file="permissions.zcml" />
|
|
14
15
|
|
|
15
16
|
<browser:page
|
|
16
17
|
name="internalnumber-settings"
|
|
@@ -5,6 +5,7 @@ from collective.behavior.internalnumber import TYPE_CONFIG
|
|
|
5
5
|
from collective.behavior.talcondition.utils import _evaluateExpression
|
|
6
6
|
from collective.z3cform.datagridfield.datagridfield import DataGridFieldFactory
|
|
7
7
|
from collective.z3cform.datagridfield.registry import DictRow
|
|
8
|
+
from operator import attrgetter
|
|
8
9
|
from plone import api
|
|
9
10
|
from plone.app.registry.browser.controlpanel import ControlPanelFormWrapper
|
|
10
11
|
from plone.app.registry.browser.controlpanel import RegistryEditForm
|
|
@@ -15,8 +16,7 @@ from Products.CMFPlone.utils import base_hasattr
|
|
|
15
16
|
from z3c.form import form
|
|
16
17
|
from zope import schema
|
|
17
18
|
from zope.component import getAllUtilitiesRegisteredFor
|
|
18
|
-
from zope.
|
|
19
|
-
from zope.i18n.interfaces import ITranslationDomain
|
|
19
|
+
from zope.i18n import translate
|
|
20
20
|
from zope.interface import implementer
|
|
21
21
|
from zope.interface import Interface
|
|
22
22
|
from zope.schema.interfaces import IVocabularyFactory
|
|
@@ -187,7 +187,7 @@ class DxPortalTypesVocabulary(object):
|
|
|
187
187
|
ftis = getAllUtilitiesRegisteredFor(IDexterityFTI)
|
|
188
188
|
portal = api.portal.get()
|
|
189
189
|
for fti in ftis:
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
190
|
+
terms.append(
|
|
191
|
+
SimpleTerm(fti.id, fti.id, translate(fti.Title(), context=portal.REQUEST)))
|
|
192
|
+
terms = sorted(terms, key=attrgetter('title'))
|
|
193
193
|
return SimpleVocabulary(terms)
|
|
@@ -3,12 +3,13 @@
|
|
|
3
3
|
xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
|
|
4
4
|
xmlns:i18n="http://namespaces.zope.org/i18n"
|
|
5
5
|
xmlns:plone="http://namespaces.plone.org/plone"
|
|
6
|
+
xmlns:zcml="http://namespaces.zope.org/zcml"
|
|
6
7
|
i18n_domain="collective.behavior.internalnumber">
|
|
7
8
|
|
|
8
9
|
<i18n:registerTranslations directory="locales" />
|
|
9
10
|
|
|
10
11
|
<include package="collective.behavior.talcondition" />
|
|
11
|
-
<include package="collective.dexteritytextindexer" />
|
|
12
|
+
<include package="collective.dexteritytextindexer" zcml:condition="not-have plone-60" />
|
|
12
13
|
<include package="collective.z3cform.datagridfield" />
|
|
13
14
|
|
|
14
15
|
<include package="plone.behavior" file="meta.zcml" />
|
|
@@ -48,6 +49,15 @@
|
|
|
48
49
|
post_handler=".setuphandlers.uninstall"
|
|
49
50
|
/>
|
|
50
51
|
|
|
52
|
+
<genericsetup:upgradeStep
|
|
53
|
+
title="Upgrade to 1001"
|
|
54
|
+
description="Remove internal_number catalog metadata"
|
|
55
|
+
source="1000"
|
|
56
|
+
destination="1001"
|
|
57
|
+
handler="collective.behavior.internalnumber.upgrades.upgrade_to_1001"
|
|
58
|
+
profile="collective.behavior.internalnumber:default"
|
|
59
|
+
/>
|
|
60
|
+
|
|
51
61
|
<utility
|
|
52
62
|
factory=".setuphandlers.HiddenProfiles"
|
|
53
63
|
name="collective.behavior.internalnumber-hiddenprofiles" />
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
2
|
|
|
3
|
+
from collective.behavior.internalnumber import PLONE_VERSION
|
|
3
4
|
from collective.behavior.internalnumber import TYPE_CONFIG
|
|
4
5
|
from collective.behavior.internalnumber.behavior import internal_number_default
|
|
5
6
|
from collective.behavior.internalnumber.behavior import InternalNumberValidator
|
|
@@ -41,7 +42,10 @@ class TestBehavior(unittest.TestCase):
|
|
|
41
42
|
def test_searchabletext_index(self):
|
|
42
43
|
fti = getUtility(IDexterityFTI, name='testtype')
|
|
43
44
|
behaviors = list(fti.behaviors)
|
|
44
|
-
|
|
45
|
+
if PLONE_VERSION < '6.0':
|
|
46
|
+
behaviors.append('collective.dexteritytextindexer.behavior.IDexterityTextIndexer')
|
|
47
|
+
else:
|
|
48
|
+
behaviors.append('plone.textindexer')
|
|
45
49
|
fti._updateProperty('behaviors', tuple(behaviors))
|
|
46
50
|
self.tt1.reindexObject()
|
|
47
51
|
pc = self.portal.portal_catalog
|
|
@@ -9,7 +9,6 @@ from collective.behavior.internalnumber.browser.settings import get_settings
|
|
|
9
9
|
from collective.behavior.internalnumber.browser.settings import increment_nb_for
|
|
10
10
|
from collective.behavior.internalnumber.browser.settings import set_settings
|
|
11
11
|
from collective.behavior.internalnumber.testing import COLLECTIVE_BEHAVIOR_INTERNALNUMBER_INTEGRATION_TESTING # noqa
|
|
12
|
-
from operator import itemgetter
|
|
13
12
|
from plone import api
|
|
14
13
|
|
|
15
14
|
import unittest
|
|
@@ -41,8 +40,7 @@ class TestSettings(unittest.TestCase):
|
|
|
41
40
|
self.assertDictEqual(get_pt_settings('testtype'), {u'u': False, u'nb': 1, 'expr': u'number'})
|
|
42
41
|
|
|
43
42
|
def test_DxPortalTypesVocabulary(self):
|
|
44
|
-
|
|
45
|
-
voc_list = sorted([(t.value, t.title) for t in voc_inst(self.portal)], key=itemgetter(1))
|
|
43
|
+
voc_list = [(t.value, t.title) for t in DxPortalTypesVocabulary()(self.portal)]
|
|
46
44
|
if PLONE_VERSION == '4.3':
|
|
47
45
|
res = [('glo_bal', u'Global configuration'), ('testtype', u'Test type')]
|
|
48
46
|
elif PLONE_VERSION == '5.2':
|
|
@@ -46,6 +46,13 @@ class TestSetup(unittest.TestCase, CommonSetup):
|
|
|
46
46
|
self.assertRaises(WrongType, api.portal.set_registry_record, TYPE_CONFIG, 'string')
|
|
47
47
|
api.portal.set_registry_record(TYPE_CONFIG, [])
|
|
48
48
|
|
|
49
|
+
def test_catalog(self):
|
|
50
|
+
catalog = api.portal.get_tool('portal_catalog')
|
|
51
|
+
# we have an index
|
|
52
|
+
self.assertTrue('internal_number' in catalog.Indexes)
|
|
53
|
+
# we no more have a metadata
|
|
54
|
+
self.assertFalse('internal_number' in catalog.schema())
|
|
55
|
+
|
|
49
56
|
|
|
50
57
|
class TestUninstall(unittest.TestCase, CommonSetup):
|
|
51
58
|
|
|
@@ -68,3 +75,10 @@ class TestUninstall(unittest.TestCase, CommonSetup):
|
|
|
68
75
|
from collective.behavior.internalnumber.interfaces import ICollectiveBehaviorInternalnumberLayer
|
|
69
76
|
from plone.browserlayer import utils
|
|
70
77
|
self.assertNotIn(ICollectiveBehaviorInternalnumberLayer, utils.registered_layers())
|
|
78
|
+
|
|
79
|
+
def test_catalog_cleaned(self):
|
|
80
|
+
catalog = api.portal.get_tool('portal_catalog')
|
|
81
|
+
# no more catalog index
|
|
82
|
+
self.assertFalse('internal_number' in catalog.Indexes)
|
|
83
|
+
# no more catalog metadata
|
|
84
|
+
self.assertFalse('internal_number' in catalog.schema())
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: collective.behavior.internalnumber
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4
|
|
4
4
|
Summary: Configurable internal number plone behavior
|
|
5
|
-
Home-page:
|
|
5
|
+
Home-page: UNKNOWN
|
|
6
6
|
Author: Stephan Geulette
|
|
7
7
|
Author-email: support@imio.be
|
|
8
8
|
License: GPL version 2
|
|
9
|
+
Project-URL: Source, https://github.com/collective/collective.behavior.internalnumber
|
|
10
|
+
Project-URL: PyPI, https://pypi.python.org/pypi/collective.behavior.internalnumber
|
|
9
11
|
Description: .. This README is meant for consumption by humans and pypi. Pypi can render rst files so please do not use Sphinx features.
|
|
10
12
|
If you want to learn more about writing documentation, please check out: http://docs.plone.org/about/documentation_styleguide.html
|
|
11
13
|
This text does not appear on pypi or github. It is a comment.
|
|
@@ -100,6 +102,19 @@ Description: .. This README is meant for consumption by humans and pypi. Pypi ca
|
|
|
100
102
|
=========
|
|
101
103
|
|
|
102
104
|
|
|
105
|
+
0.4 (2024-06-07)
|
|
106
|
+
----------------
|
|
107
|
+
|
|
108
|
+
- Use `fti.Title()` that is a i18n `Message` instance to manage settings
|
|
109
|
+
`portal_types` vocabulary. Also sort vocabulary by term title.
|
|
110
|
+
[gbastien]
|
|
111
|
+
|
|
112
|
+
0.3 (2023-11-27)
|
|
113
|
+
----------------
|
|
114
|
+
|
|
115
|
+
- Removed catalog metadata `internal_number`, added upgrade step to 1001.
|
|
116
|
+
[gbastien]
|
|
117
|
+
|
|
103
118
|
0.2 (2023-05-31)
|
|
104
119
|
----------------
|
|
105
120
|
|
|
@@ -30,6 +30,7 @@ src/collective/behavior/internalnumber/setuphandlers.py
|
|
|
30
30
|
src/collective/behavior/internalnumber/subscribers.py
|
|
31
31
|
src/collective/behavior/internalnumber/testing.py
|
|
32
32
|
src/collective/behavior/internalnumber/testing.zcml
|
|
33
|
+
src/collective/behavior/internalnumber/upgrades.py
|
|
33
34
|
src/collective/behavior/internalnumber/browser/__init__.py
|
|
34
35
|
src/collective/behavior/internalnumber/browser/configure.zcml
|
|
35
36
|
src/collective/behavior/internalnumber/browser/settings.py
|
|
@@ -46,6 +47,7 @@ src/collective/behavior/internalnumber/profiles/testing/metadata.xml
|
|
|
46
47
|
src/collective/behavior/internalnumber/profiles/testing/types.xml
|
|
47
48
|
src/collective/behavior/internalnumber/profiles/testing/types/testtype.xml
|
|
48
49
|
src/collective/behavior/internalnumber/profiles/uninstall/browserlayer.xml
|
|
50
|
+
src/collective/behavior/internalnumber/profiles/uninstall/catalog.xml
|
|
49
51
|
src/collective/behavior/internalnumber/tests/__init__.py
|
|
50
52
|
src/collective/behavior/internalnumber/tests/test_behavior.py
|
|
51
53
|
src/collective/behavior/internalnumber/tests/test_robot.py
|
{collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/CONTRIBUTORS.rst
RENAMED
|
File without changes
|
{collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/MANIFEST.in
RENAMED
|
File without changes
|
{collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/README.rst
RENAMED
|
File without changes
|
{collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/docs/LICENSE.GPL
RENAMED
|
File without changes
|
{collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/docs/LICENSE.rst
RENAMED
|
File without changes
|
{collective.behavior.internalnumber-0.2 → collective.behavior.internalnumber-0.4}/docs/index.rst
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|