Compare commits

...

18 Commits

Author SHA1 Message Date
4df36a5548 3.0 rc7 2019-06-05 15:03:17 +02:00
aa11e3b79c can retrieve metaconfig/mixconfig/config in a metaconfig/mixconfig 2019-06-05 14:37:58 +02:00
07e6ea5eb2 can add new config with mixconfig type 2019-06-05 12:33:00 +02:00
e7cbd7849a add test for config's deepcopy 2019-05-28 07:19:26 +02:00
b9e9e98270 reindent 2019-05-27 16:21:43 +02:00
a774378732 local must not be None 2019-05-27 16:18:57 +02:00
5498a12b2b copy/deepcopy groupconfig 2019-05-27 16:11:41 +02:00
552cd3740d todict: better support for callback 2019-05-09 20:32:43 +02:00
5ea35bf84e simplify tiramisu dict format 2019-04-22 10:51:44 +02:00
6d0d233d9b demoting_error_warning is not more mandatory in option.dict()
RequirementError returns proptype
better submulti support for valid_mandatory
2019-04-17 19:13:40 +02:00
829247e79f better symlink support for option.dict() 2019-04-17 19:13:17 +02:00
63094f7e54 better error messages with list 2019-04-13 22:04:49 +02:00
1aec891408 import tiramisu-json in tiramisu repository 2019-04-08 20:34:05 +02:00
48b3b7e8a4 flit 2019-04-07 20:51:53 +02:00
4dbb82ed3f Python Packaging Autority recommandations 2019-04-05 22:39:24 +02:00
97b75660c5 do not change Config contexts properties when reload in MetaConfig (fixes #7) 2019-04-05 22:11:54 +02:00
06f501ad05 test for property in persistent storage 2019-04-05 21:17:36 +02:00
2b45955886 add/remove config in mixconfig or metaconfig (fixes #6) 2019-04-05 21:00:25 +02:00
229 changed files with 6401 additions and 530 deletions

1
.gitignore vendored
View File

@ -3,5 +3,4 @@
*.pyc
*.mo
*.swp
version.in
build/

View File

@ -1,4 +1,21 @@
Sun Mar 24 20:24:34 2019
Mon Jun 5 14:49:27 2019 +0200 Emmanuel Garette <egarette@cadoles.com>
* version 3.0 rc7
* retrieve metaconfig/mixconfig/config by name in a metaconfig/mixconfig
* add new config with mixconfig type
Mon Apr 8 08:40:10 2019 +0200 Emmanuel Garette <egarette@cadoles.com>
* version 3.0 rc6
* import tiramisu-json in tiramisu repository
Fri Apr 5 20:57:05 2019 +0200 Emmanuel Garette <egarette@cadoles.com>
* version 3.0 rc4 and rc5
* change filename/directory name with Python Packaging Autority
recommendations
* do not change Config contexts properties when reload in MetaConfig
(fixes #7)
* add/remove config in mixconfig or metaconfig (fixes #6)
Sun Mar 24 20:24:34 2019 +0200 Emmanuel Garette <egarette@cadoles.com>
* version 3.0 rc3
* corrections in debug logger
* requirement can have callback

8
MANIFEST.in Normal file
View File

@ -0,0 +1,8 @@
# Include the README
include *.rst
# Include the license file
include LICENSE.txt
# Include the data files
recursive-include tiramisu *.py *.mo

View File

@ -10,7 +10,7 @@ INSTALL_DATA := install -m 644
INSTALL_PROGRAM := install -m 755
INSTALL_DIR := install -m 755 -d
TRADUC_DIR = translations
TRADUC_DIR = tiramisu/locale
TRADUC_DEST = $(DESTDIR)/usr/share/locale
PYTHON_OPTS =
@ -26,7 +26,7 @@ define gettext
else \
P="pygettext.py" ; \
fi ; \
$$P -p translations/ -o $(PACKAGE).pot `find $(PACKAGE)/ -name "*.py"`
$$P -p $(TRADUC_DIR)/ -o $(PACKAGE).pot `find $(PACKAGE)/ -name "*.py"`
endef
# Build translation files
@ -69,12 +69,12 @@ build-pot:
build-lang:
$(call build_translation, $(TRADUC_DIR))
install-lang:
$(INSTALL_DIR) $(TRADUC_DEST)
$(call install_translation, $(TRADUC_DIR))
# install-lang:
# $(INSTALL_DIR) $(TRADUC_DEST)
# $(call install_translation, $(TRADUC_DIR))
install: install-lang
python setup.py install --no-compile $(PYTHON_OPTS)
install: # install-lang
python3 setup.py install --no-compile $(PYTHON_OPTS)
dist:
git archive --format=tar --prefix $(PACKAGE)-$(VERSION)/ HEAD | gzip -9 > $(PACKAGE)-$(VERSION).tar.gz

View File

View File

@ -1 +0,0 @@
master

17
pyproject.toml Normal file
View File

@ -0,0 +1,17 @@
[build-system]
requires = ["flit"]
build-backend = "flit.buildapi"
[tool.flit.metadata]
module = "tiramisu"
author = "Emmanuel Garette"
author-email = "gnunux@gnunux.info"
home-page = "https://framagit.org/tiramisu/tiramisu"
classifiers = [
"License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)",
"Programming Language :: Python :: 3",
"Natural Language :: English",
"Natural Language :: French",
"Operating System :: OS Independent",
]
requires-python = ">=3.5"

View File

@ -1,57 +1,28 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from distutils.core import setup
from setuptools import setup, find_packages
from os.path import dirname, abspath, join, normpath, isdir
from os import listdir
import os
from tiramisu import __version__
package_name = os.environ.get('PACKAGE_DST', 'tiramisu')
def fetch_version():
"""Get version from version.in"""
return open('VERSION', 'r').readline().strip()
def return_files(component):
here = dirname(abspath(__file__))
path = normpath(join(here, 'tiramisu', component))
dir_content = [content for content in listdir(path)
if not content == '__pycache__']
paths = filter(isdir, [join(path, content)
for content in dir_content])
lst = ['.'.join(path.split('/')[-3:]) for path in paths]
#lst = [package_name + '.' + '.'.join(path.split('/')[-2:]) for path in paths]
return lst
packages = [package_name, package_name + '.storage', package_name + '.option']
packages.extend(return_files('storage'))
packages.extend(return_files('option'))
if package_name != 'tiramisu':
package_dir = {package_name: 'tiramisu'}
else:
package_dir = {}
PACKAGE_NAME = os.environ.get('PACKAGE_DST', 'tiramisu')
setup(
version=__version__,
author="Tiramisu's team",
author_email='contact@cadoles.com',
name=package_name,
version=fetch_version(),
author_email='gnunux@gnunux.info',
name=PACKAGE_NAME,
description='an options controller tool',
url='http://tiramisu.labs.libre-entreprise.org/',
url='https://framagit.org/tiramisu/tiramisu',
license='GNU Library or Lesser General Public License (LGPL)',
classifiers=[
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 3",
"Development Status :: 4 - Beta",
"Environment :: Other Environment",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)",
"Operating System :: OS Independent",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Text Processing :: Linguistic"
"Natural Language :: English",
"Natural Language :: French",
],
long_description="""\
An options controller tool
@ -67,8 +38,8 @@ Tiramisu is an options handler and an options controller, wich aims at
producing flexible and fast options access.
This version requires Python 2.6 or later.
This version requires Python 3.5 or later.
""",
packages=packages,
package_dir=package_dir
include_package_data=True,
packages=find_packages(include=['tiramisu'])
)

0
tests/dict/__init__.py Normal file
View File

View File

View File

@ -0,0 +1,24 @@
{
"schema": {
"options": {
"properties": {
"options.boolean": {
"type": "boolean",
"title": "Boolean 1"
}
},
"type": "object",
"title": "Common configuration"
}
},
"model": {},
"form": {
"null": [
{
"title": "Configurer",
"type": "submit"
}
]
},
"version": "1.0"
}

View File

@ -0,0 +1,12 @@
"""just an boolean option
"""
from tiramisu.option import BoolOption, OptionDescription
def get_description():
"""generate description for this test
"""
option = BoolOption('boolean', "Boolean 1")
descr1 = OptionDescription("options", "Common configuration", [option])
descr = OptionDescription("boolean1", "Simple boolean", [descr1])
return descr

View File

@ -0,0 +1,28 @@
{
"schema": {
"options": {
"properties": {
"options.boolean": {
"type": "boolean",
"title": "Boolean 1 frozen"
}
},
"type": "object",
"title": "Common configuration"
}
},
"model": {
"options.boolean": {
"readOnly": true
}
},
"form": {
"null": [
{
"title": "Configurer",
"type": "submit"
}
]
},
"version": "1.0"
}

View File

@ -0,0 +1,12 @@
"""just an boolean option
"""
from tiramisu.option import BoolOption, OptionDescription
def get_description():
"""generate description for this test
"""
option = BoolOption('boolean', "Boolean 1 frozen", properties=('frozen',))
descr1 = OptionDescription("options", "Common configuration", [option])
descr = OptionDescription("boolean1_frozen", "Simple boolean", [descr1])
return descr

View File

@ -0,0 +1,32 @@
{
"schema": {
"options": {
"properties": {
"options.choice": {
"type": "choice",
"enum": [
"",
"choice 1",
"choice 2"
],
"title": "Choice description"
}
},
"type": "object",
"title": "Common configuration"
}
},
"model": {},
"form": {
"options.choice": {
"type": "choice"
},
"null": [
{
"title": "Configurer",
"type": "submit"
}
]
},
"version": "1.0"
}

View File

@ -0,0 +1,10 @@
from tiramisu.option import ChoiceOption, OptionDescription
def get_description():
"""generate description for this test
"""
option = ChoiceOption('choice', "Choice description", ("choice 1", "choice 2"))
descr1 = OptionDescription("options", "Common configuration", [option])
descr = OptionDescription("choice1", "Simple choice", [descr1])
return descr

View File

@ -0,0 +1,36 @@
{
"schema": {
"options": {
"properties": {
"options.choice": {
"type": "choice",
"enum": [
"",
"choice 1",
"choice 2"
],
"title": "Choice description frozen"
}
},
"type": "object",
"title": "Common configuration"
}
},
"model": {
"options.choice": {
"readOnly": true
}
},
"form": {
"options.choice": {
"type": "choice"
},
"null": [
{
"title": "Configurer",
"type": "submit"
}
]
},
"version": "1.0"
}

View File

@ -0,0 +1,10 @@
from tiramisu.option import ChoiceOption, OptionDescription
def get_description():
"""generate description for this test
"""
option = ChoiceOption('choice', "Choice description frozen", ("choice 1", "choice 2"), properties=('frozen',))
descr1 = OptionDescription("options", "Common configuration", [option])
descr = OptionDescription("choice1_frozen", "Simple choice", [descr1])
return descr

View File

@ -0,0 +1,81 @@
{
"schema": {
"options": {
"properties": {
"options.choice1": {
"properties": {
"options.choice1.choice1": {
"type": "choice",
"isMulti": true,
"enum": [
"choice 1",
"choice 2"
],
"title": "Choice description leader"
},
"options.choice1.choice2": {
"type": "choice",
"isMulti": true,
"enum": [
"",
"choice 3",
"choice 4"
],
"title": "Choice description follower 1"
},
"options.choice1.choice3": {
"type": "choice",
"isMulti": true,
"enum": [
"",
"choice 5",
"choice 6"
],
"title": "Choice description follower 2"
},
"options.choice1.choice4": {
"type": "choice",
"isMulti": true,
"enum": [
"",
"choice 7",
"choice 8"
],
"title": "Choice description follower 3"
}
},
"type": "array",
"title": "Common configuration 1"
}
},
"type": "object",
"title": "Common configuration 2"
}
},
"model": {
"options.choice1.choice1": {
"required": true
}
},
"form": {
"options.choice1.choice1": {
"type": "choice"
},
"options.choice1.choice2": {
"type": "choice"
},
"options.choice1.choice3": {
"type": "choice"
},
"options.choice1.choice4": {
"type": "choice"
},
"null": [
{
"title": "Configurer",
"type": "submit"
}
]
},
"version": "1.0"
}

View File

@ -0,0 +1,16 @@
from tiramisu.option import ChoiceOption, OptionDescription
from tiramisu import Leadership
def get_description():
"""generate description for this test
"""
option = ChoiceOption('choice1', "Choice description leader", ("choice 1", "choice 2"), multi=True)
option1 = ChoiceOption('choice2', "Choice description follower 1", ("choice 3", "choice 4"), multi=True)
option2 = ChoiceOption('choice3', "Choice description follower 2", ("choice 5", "choice 6"), multi=True)
option3 = ChoiceOption('choice4', "Choice description follower 3", ("choice 7", "choice 8"), multi=True)
descr1 = Leadership("choice1", "Common configuration 1",
[option, option1, option2, option3])
descr = OptionDescription("options", "Common configuration 2", [descr1])
descr = OptionDescription("choice1_leadership", "Leader followers with choice", [descr])
return descr

View File

@ -0,0 +1,87 @@
{
"schema": {
"options": {
"properties": {
"options.choice1": {
"properties": {
"options.choice1.choice1": {
"type": "choice",
"isMulti": true,
"enum": [
"choice 1",
"choice 2"
],
"title": "Choice description leader"
},
"options.choice1.choice2": {
"type": "choice",
"isMulti": true,
"enum": [
"",
"choice 3",
"choice 4"
],
"title": "Choice description follower 1"
},
"options.choice1.choice3": {
"type": "choice",
"isMulti": true,
"enum": [
"",
"choice 5",
"choice 6"
],
"title": "Choice description follower 2 hidden"
},
"options.choice1.choice4": {
"type": "choice",
"isMulti": true,
"enum": [
"",
"choice 7",
"choice 8"
],
"title": "Choice description follower 3"
}
},
"type": "array",
"title": "Slave 2 is hidden"
}
},
"type": "object",
"title": "Common configuration 2"
}
},
"model": {
"options.choice1.choice1": {
"required": true
},
"options.choice1.choice3": {
"null": {
"display": false,
"hidden": true
}
}
},
"form": {
"options.choice1.choice1": {
"type": "choice"
},
"options.choice1.choice2": {
"type": "choice"
},
"options.choice1.choice3": {
"type": "choice"
},
"options.choice1.choice4": {
"type": "choice"
},
"null": [
{
"title": "Configurer",
"type": "submit"
}
]
},
"version": "1.0"
}

View File

@ -0,0 +1,16 @@
from tiramisu.option import ChoiceOption, OptionDescription
from tiramisu import Leadership
from tiramisu.setting import groups
def get_description():
"""generate description for this test
"""
option = ChoiceOption('choice1', "Choice description leader", ("choice 1", "choice 2"), multi=True)
option1 = ChoiceOption('choice2', "Choice description follower 1", ("choice 3", "choice 4"), multi=True)
option2 = ChoiceOption('choice3', "Choice description follower 2 hidden", ("choice 5", "choice 6"), multi=True, properties=('hidden',))
option3 = ChoiceOption('choice4', "Choice description follower 3", ("choice 7", "choice 8"), multi=True)
descr1 = Leadership("choice1", "Slave 2 is hidden",
[option, option1, option2, option3])
descr = OptionDescription("options", "Common configuration 2", [descr1])
descr = OptionDescription("choice1_leadership_hidden", "Leader follower with choice, one is hidden", [descr])
return descr

View File

@ -0,0 +1,91 @@
{
"schema": {
"options": {
"properties": {
"options.choice1": {
"properties": {
"options.choice1.choice1": {
"type": "choice",
"isMulti": true,
"enum": [
"choice 1",
"choice 2"
],
"title": "Choice leader"
},
"options.choice1.choice2": {
"type": "choice",
"isMulti": true,
"enum": [
"",
"choice 3",
"choice 4"
],
"title": "Choice follower 1"
},
"options.choice1.choice3": {
"type": "choice",
"isMulti": true,
"enum": [
"",
"choice 5",
"choice 6"
],
"title": "Choice follower 2"
},
"options.choice1.choice4": {
"type": "choice",
"isMulti": true,
"enum": [
"",
"choice 7",
"choice 8"
],
"title": "Choice follower 3"
}
},
"type": "array",
"title": "Common configuration 1"
}
},
"type": "object",
"title": "Common configuration 2"
}
},
"model": {
"options.choice1.choice1": {
"required": true,
"value": [
"choice 2"
],
"owner": "user"
},
"options.choice1.choice2": {
"0": {
"value": "choice 4",
"owner": "user"
}
}
},
"form": {
"options.choice1.choice1": {
"type": "choice"
},
"options.choice1.choice2": {
"type": "choice"
},
"options.choice1.choice3": {
"type": "choice"
},
"options.choice1.choice4": {
"type": "choice"
},
"null": [
{
"title": "Configurer",
"type": "submit"
}
]
},
"version": "1.0"
}

View File

@ -0,0 +1,25 @@
from tiramisu.option import ChoiceOption, OptionDescription
from tiramisu import Leadership
def get_description():
"""generate description for this test
"""
option = ChoiceOption('choice1', "Choice leader", ("choice 1", "choice 2"), multi=True)
option1 = ChoiceOption('choice2', "Choice follower 1", ("choice 3", "choice 4"), multi=True)
option2 = ChoiceOption('choice3', "Choice follower 2", ("choice 5", "choice 6"), multi=True)
option3 = ChoiceOption('choice4', "Choice follower 3", ("choice 7", "choice 8"), multi=True)
descr1 = Leadership("choice1", "Common configuration 1",
[option, option1, option2, option3])
descr = OptionDescription("options", "Common configuration 2", [descr1])
descr = OptionDescription("choice1_leadership_value", "Leader followers with choices, leader is 'choice 2' and follower 1 is 'choice 4'", [descr])
return descr
def get_values(api, allpath=False):
if allpath:
root = 'choice1_leadership_value.'
else:
root = ''
api.option(root + 'options.choice1.choice1').value.set(['choice 2'])
api.option(root + 'options.choice1.choice2', 0).value.set('choice 4')

View File

@ -0,0 +1,36 @@
{
"schema": {
"options": {
"properties": {
"options.choice": {
"type": "choice",
"isMulti": true,
"enum": [
"choice 1",
"choice 2"
],
"title": "Choice description"
}
},
"type": "object",
"title": "Common configuration"
}
},
"model": {
"options.choice": {
"required": true
}
},
"form": {
"options.choice": {
"type": "choice"
},
"null": [
{
"title": "Configurer",
"type": "submit"
}
]
},
"version": "1.0"
}

View File

@ -0,0 +1,10 @@
from tiramisu.option import ChoiceOption, OptionDescription
def get_description():
"""generate description for this test
"""
option = ChoiceOption('choice', "Choice description", ("choice 1", "choice 2"), multi=True)
descr1 = OptionDescription("options", "Common configuration", [option])
descr = OptionDescription("choice1_multi", "Multi choice", [descr1])
return descr

View File

@ -0,0 +1,36 @@
{
"schema": {
"options": {
"properties": {
"options.choice": {
"type": "choice",
"enum": [
"",
"choice 1",
"choice 2"
],
"title": "Choice description"
}
},
"type": "object",
"title": "Common configuration"
}
},
"model": {},
"form": {
"options.choice": {
"type": "choice",
"displayed": {
"choice 1": "renamed 1",
"choice 2": "renamed 2"
}
},
"null": [
{
"title": "Configurer",
"type": "submit"
}
]
},
"version": "1.0"
}

View File

@ -0,0 +1,20 @@
from tiramisu.option import ChoiceOption, OptionDescription
def get_description():
"""generate description for this test
"""
option = ChoiceOption('choice', "Choice description", ("choice 1", "choice 2"))
descr1 = OptionDescription("options", "Common configuration", [option])
descr = OptionDescription("choice1_rename", "Rename displayed value", [descr1])
return descr
def get_form(allpath=False):
key = 'options.choice'
if allpath:
key = 'choice1_rename.' + key
return [{'key': key,
'displayed': {'choice 1': 'renamed 1',
'choice 2': 'renamed 2'}
}]

View File

@ -0,0 +1,68 @@
{
"schema": {
"options": {
"properties": {
"options.choice": {
"type": "choice",
"value": "hide",
"enum": [
"hide",
"show"
],
"title": "Choice description"
},
"options.unicode2": {
"type": "string",
"title": "Unicode 2"
}
},
"type": "object",
"title": "Common configuration"
}
},
"model": {
"options.choice": {
"required": true,
"value": "hide",
"owner": "default"
},
"options.unicode2": {
"hidden": true
}
},
"form": {
"options.choice": {
"clearable": true,
"type": "choice",
"dependencies": {
"default": {
"show": [
"options.unicode2"
]
},
"expected": {
"hide": {
"hide": [
"options.unicode2"
]
},
"show": {
"show": [
"options.unicode2"
]
}
}
}
},
"options.unicode2": {
"type": "input"
},
"null": [
{
"title": "Configurer",
"type": "submit"
}
]
},
"version": "1.0"
}

View File

@ -0,0 +1,12 @@
from tiramisu.option import ChoiceOption, StrOption, OptionDescription
def get_description():
"""generate description for this test
"""
option1 = ChoiceOption('choice', "Choice description", ("hide", "show"), default='hide', properties=('mandatory',))
option2 = StrOption('unicode2', "Unicode 2", requires=[{'option': option1,
'expected': 'hide',
'action': 'hidden'}])
descr1 = OptionDescription("options", "Common configuration", [option1, option2])
descr = OptionDescription("choice1_requires", "Choice with requirement", [descr1])
return descr

View File

@ -0,0 +1,24 @@
{
"schema": {
"options": {
"properties": {
"options.date": {
"type": "date",
"title": "Date description"
}
},
"type": "object",
"title": "Common configuration"
}
},
"model": {},
"form": {
"null": [
{
"title": "Configurer",
"type": "submit"
}
]
},
"version": "1.0"
}

9
tests/dict/data/date1.py Normal file
View File

@ -0,0 +1,9 @@
from tiramisu.option import DateOption, OptionDescription
def get_description():
"""generate description for this test
"""
option = DateOption('date', "Date description")
descr1 = OptionDescription("options", "Common configuration", [option])
descr = OptionDescription("date1", "Simple date", [descr1])
return descr

View File

@ -0,0 +1,28 @@
{
"schema": {
"options": {
"properties": {
"options.date": {
"type": "date",
"title": "Date description frozen"
}
},
"type": "object",
"title": "Common configuration"
}
},
"model": {
"options.date": {
"readOnly": true
}
},
"form": {
"null": [
{
"title": "Configurer",
"type": "submit"
}
]
},
"version": "1.0"
}

View File

@ -0,0 +1,9 @@
from tiramisu.option import DateOption, OptionDescription
def get_description():
"""generate description for this test
"""
option = DateOption('date', "Date description frozen", properties=('frozen',))
descr1 = OptionDescription("options", "Common configuration", [option])
descr = OptionDescription("date1_frozen", "Simple date", [descr1])
return descr

View File

@ -0,0 +1,26 @@
{
"schema": {
"usbpath": {
"type": "filename",
"title": "Chemin d'acc\u00e8s"
}
},
"model": {
"usbpath": {
"required": true
}
},
"form": {
"usbpath": {
"pattern": "^[a-zA-Z0-9\\-\\._~/+]+$",
"type": "input"
},
"null": [
{
"title": "Configurer",
"type": "submit"
}
]
},
"version": "1.0"
}

View File

@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-
from tiramisu.option import FilenameOption, OptionDescription
def get_description():
usbpath = FilenameOption('usbpath', "Chemin d'accès", properties=('mandatory',))
descr = OptionDescription("filename1", "Simple filename", [usbpath])
return descr

View File

@ -0,0 +1,52 @@
{
"schema": {
"options": {
"properties": {
"options.hostname1": {
"type": "domainname",
"title": "Domainname Description"
},
"options.hostname2": {
"type": "domainname",
"title": "Domainname without dot Description"
},
"options.hostname3": {
"type": "domainname",
"title": "Hostname or IP Description"
},
"options.hostname4": {
"type": "domainname",
"title": "Netbios Description"
}
},
"type": "object",
"title": "Common configuration"
}
},
"model": {},
"form": {
"options.hostname1": {
"pattern": "^((?!-)[a-z0-9-]{1,63}\\.){1,}[a-z0-9-]{1,63}$",
"type": "input"
},
"options.hostname2": {
"pattern": "^((?!-)[a-z0-9-]{0,63}\\.){0,}[a-z0-9-]{1,63}$",
"type": "input"
},
"options.hostname3": {
"pattern": "^(?:((?!-)[a-z0-9-]{1,63})|(?:(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)))$",
"type": "input"
},
"options.hostname4": {
"pattern": "^((?!-)[a-z0-9-]{1,15})$",
"type": "input"
},
"null": [
{
"title": "Configurer",
"type": "submit"
}
]
},
"version": "1.0"
}

View File

@ -0,0 +1,12 @@
from tiramisu.option import DomainnameOption, OptionDescription
def get_description():
"""generate description for this test
"""
option1 = DomainnameOption('hostname1', "Domainname Description")
option2 = DomainnameOption('hostname2', "Domainname without dot Description", allow_without_dot=True)
option3 = DomainnameOption('hostname3', "Hostname or IP Description", type_='hostname', allow_ip=True)
option4 = DomainnameOption('hostname4', "Netbios Description", type_='netbios')
descr1 = OptionDescription("options", "Common configuration", [option1, option2, option3, option4])
descr = OptionDescription("hostname1", "Simple hostnames", [descr1])
return descr

28
tests/dict/data/ip1.json Normal file
View File

@ -0,0 +1,28 @@
{
"schema": {
"options": {
"properties": {
"options.ip": {
"type": "ip",
"title": "IP Description"
}
},
"type": "object",
"title": "Common configuration"
}
},
"model": {},
"form": {
"options.ip": {
"pattern": "^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$",
"type": "input"
},
"null": [
{
"title": "Configurer",
"type": "submit"
}
]
},
"version": "1.0"
}

9
tests/dict/data/ip1.py Normal file
View File

@ -0,0 +1,9 @@
from tiramisu.option import IPOption, OptionDescription
def get_description():
"""generate description for this test
"""
option1 = IPOption('ip', "IP Description")
descr1 = OptionDescription("options", "Common configuration", [option1])
descr = OptionDescription("ip1", "Simple IP", [descr1])
return descr

View File

@ -0,0 +1,32 @@
{
"schema": {
"options": {
"properties": {
"options.ip": {
"type": "ip",
"title": "IP Description frozen"
}
},
"type": "object",
"title": "Common configuration"
}
},
"model": {
"options.ip": {
"readOnly": true
}
},
"form": {
"options.ip": {
"pattern": "^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$",
"type": "input"
},
"null": [
{
"title": "Configurer",
"type": "submit"
}
]
},
"version": "1.0"
}

View File

@ -0,0 +1,9 @@
from tiramisu.option import IPOption, OptionDescription
def get_description():
"""generate description for this test
"""
option1 = IPOption('ip', "IP Description frozen", properties=('frozen',))
descr1 = OptionDescription("options", "Common configuration", [option1])
descr = OptionDescription("ip1_frozen", "Simple IP", [descr1])
return descr

View File

@ -0,0 +1,28 @@
{
"schema": {
"options": {
"properties": {
"options.mail": {
"type": "email",
"title": "Mail Description"
}
},
"type": "object",
"title": "Common configuration"
}
},
"model": {},
"form": {
"options.mail": {
"pattern": "^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$",
"type": "input"
},
"null": [
{
"title": "Configurer",
"type": "submit"
}
]
},
"version": "1.0"
}

10
tests/dict/data/mail1.py Normal file
View File

@ -0,0 +1,10 @@
from tiramisu.option import EmailOption, OptionDescription
def get_description():
"""generate description for this test
"""
option = EmailOption('mail', "Mail Description")
descr1 = OptionDescription("options", "Common configuration", [option])
descr = OptionDescription("mail1", "Simple mail", [descr1])
return descr

View File

@ -0,0 +1,28 @@
{
"schema": {
"options": {
"properties": {
"options.integer": {
"type": "integer",
"title": "integer 1"
}
},
"type": "object",
"title": "Common configuration"
}
},
"model": {},
"form": {
"options.integer": {
"pattern": "^[0-9]+$",
"type": "input"
},
"null": [
{
"title": "Configurer",
"type": "submit"
}
]
},
"version": "1.0"
}

View File

@ -0,0 +1,10 @@
from tiramisu.option import IntOption, OptionDescription
def get_description():
"""generate description for this test
"""
option = IntOption('integer', "integer 1")
descr1 = OptionDescription("options", "Common configuration", [option])
descr = OptionDescription("number1", "Simple number", [descr1])
return descr

View File

@ -0,0 +1,32 @@
{
"schema": {
"options": {
"properties": {
"options.integer": {
"type": "integer",
"title": "integer 1 frozen"
}
},
"type": "object",
"title": "Common configuration"
}
},
"model": {
"options.integer": {
"readOnly": true
}
},
"form": {
"options.integer": {
"pattern": "^[0-9]+$",
"type": "input"
},
"null": [
{
"title": "Configurer",
"type": "submit"
}
]
},
"version": "1.0"
}

View File

@ -0,0 +1,10 @@
from tiramisu.option import IntOption, OptionDescription
def get_description():
"""generate description for this test
"""
option = IntOption('integer', "integer 1 frozen", properties=('frozen',))
descr1 = OptionDescription("options", "Common configuration", [option])
descr = OptionDescription("number1_frozen", "Simple number", [descr1])
return descr

View File

@ -0,0 +1,35 @@
{
"schema": {
"options": {
"properties": {
"options.integer": {
"type": "integer",
"value": 0,
"title": "integer 1"
}
},
"type": "object",
"title": "Common configuration"
}
},
"model": {
"options.integer": {
"value": 3,
"owner": "user"
}
},
"form": {
"options.integer": {
"clearable": true,
"pattern": "^[0-9]+$",
"type": "input"
},
"null": [
{
"title": "Configurer",
"type": "submit"
}
]
},
"version": "1.0"
}

View File

@ -0,0 +1,18 @@
from tiramisu.option import IntOption, OptionDescription
def get_description():
"""generate description for this test
"""
option = IntOption('integer', "integer 1", 0)
descr1 = OptionDescription("options", "Common configuration", [option])
descr = OptionDescription("number1_mod_value", "Number with modified value 3 and default value 0", [descr1])
return descr
def get_values(api, allpath=False):
if allpath:
root = 'number1_mod_value.'
else:
root = ''
api.option(root + 'options.integer').value.set(3)

View File

@ -0,0 +1,35 @@
{
"schema": {
"options": {
"properties": {
"options.integer": {
"type": "integer",
"value": 0,
"title": "integer 1"
}
},
"type": "object",
"title": "Common configuration"
}
},
"model": {
"options.integer": {
"value": 0,
"owner": "default"
}
},
"form": {
"options.integer": {
"clearable": true,
"pattern": "^[0-9]+$",
"type": "input"
},
"null": [
{
"title": "Configurer",
"type": "submit"
}
]
},
"version": "1.0"
}

View File

@ -0,0 +1,11 @@
from tiramisu.option import IntOption, OptionDescription
def get_description():
"""generate description for this test
"""
option = IntOption('integer', "integer 1", 0)
descr1 = OptionDescription("options", "Common configuration", [option])
descr = OptionDescription("number1_value", "Number with value 0", [descr1])
return descr

View File

@ -0,0 +1 @@
{"options.unicode": null}

View File

@ -0,0 +1 @@
{"options.unicode": "val"}

View File

@ -0,0 +1,27 @@
{
"schema": {
"options": {
"properties": {
"options.unicode": {
"type": "string",
"title": "Unicode 1"
}
},
"type": "object",
"title": "Common configuration"
}
},
"model": {},
"form": {
"options.unicode": {
"type": "input"
},
"null": [
{
"title": "Configurer",
"type": "submit"
}
]
},
"version": "1.0"
}

View File

@ -0,0 +1,5 @@
{"cmd": "config.option('options.unicode').value.set('val')",
"body": {"updates": [{"action": "modify",
"name": "options.unicode",
"value": "val"}]}
}

View File

@ -0,0 +1,11 @@
"""just an unicode option
"""
from tiramisu.option import StrOption, OptionDescription
def get_description():
"""generate description for this test
"""
option = StrOption('unicode', "Unicode 1")
descr1 = OptionDescription("options", "Common configuration", [option])
descr = OptionDescription("unicode1", "Simple unicode", [descr1])
return descr

View File

@ -0,0 +1,3 @@
{"updates": ["options.unicode"],
"model": {"options.unicode": {"owner": "user",
"value": "val"}}}

View File

@ -0,0 +1,31 @@
{
"schema": {
"options": {
"properties": {
"options.unicode": {
"type": "string",
"title": "Unicode 1 frozen"
}
},
"type": "object",
"title": "Common configuration"
}
},
"model": {
"options.unicode": {
"readOnly": true
}
},
"form": {
"options.unicode": {
"type": "input"
},
"null": [
{
"title": "Configurer",
"type": "submit"
}
]
},
"version": "1.0"
}

View File

@ -0,0 +1,11 @@
"""just an unicode option
"""
from tiramisu.option import StrOption, OptionDescription
def get_description():
"""generate description for this test
"""
option = StrOption('unicode', "Unicode 1 frozen", properties=('frozen',))
descr1 = OptionDescription("options", "Common configuration", [option])
descr = OptionDescription("unicode1_frozen", "Simple unicode", [descr1])
return descr

View File

@ -0,0 +1,64 @@
{
"schema": {
"options": {
"properties": {
"options.unicode": {
"properties": {
"options.unicode.unicode": {
"type": "string",
"isMulti": true,
"title": "Unicode leader"
},
"options.unicode.unicode1": {
"type": "string",
"isMulti": true,
"title": "Unicode follower 1"
},
"options.unicode.unicode2": {
"type": "string",
"isMulti": true,
"title": "Unicode follower 2"
},
"options.unicode.unicode3": {
"type": "string",
"isMulti": true,
"title": "Unicode follower 3"
}
},
"type": "array",
"title": "Common configuration"
}
},
"type": "object",
"title": "Common configuration"
}
},
"model": {
"options.unicode.unicode": {
"display": false,
"required": true,
"hidden": true
}
},
"form": {
"options.unicode.unicode": {
"type": "input"
},
"options.unicode.unicode1": {
"type": "input"
},
"options.unicode.unicode2": {
"type": "input"
},
"options.unicode.unicode3": {
"type": "input"
},
"null": [
{
"title": "Configurer",
"type": "submit"
}
]
},
"version": "1.0"
}

View File

@ -0,0 +1,15 @@
from tiramisu.option import UnicodeOption, OptionDescription
from tiramisu import Leadership
def get_description():
"""generate description for this test
"""
option = UnicodeOption('unicode', "Unicode leader", multi=True, properties=('hidden',))
option1 = UnicodeOption('unicode1', "Unicode follower 1", multi=True)
option2 = UnicodeOption('unicode2', "Unicode follower 2", multi=True)
option3 = UnicodeOption('unicode3', "Unicode follower 3", multi=True)
descr1 = Leadership("unicode", "Common configuration",
[option, option1, option2, option3])
descr = OptionDescription("options", "Common configuration", [descr1])
descr = OptionDescription("unicode1_leader_hidden_followers", "Leader follower with unicode and hidden leader", [descr])
return descr

View File

@ -0,0 +1,62 @@
{
"schema": {
"options": {
"properties": {
"options.unicode": {
"properties": {
"options.unicode.unicode": {
"type": "string",
"isMulti": true,
"title": "Unicode leader"
},
"options.unicode.unicode1": {
"type": "string",
"isMulti": true,
"title": "Unicode follower 1"
},
"options.unicode.unicode2": {
"type": "string",
"isMulti": true,
"title": "Unicode follower 2"
},
"options.unicode.unicode3": {
"type": "string",
"isMulti": true,
"title": "Unicode follower 3"
}
},
"type": "array",
"title": "Common configuration 1"
}
},
"type": "object",
"title": "Common configuration 2"
}
},
"model": {
"options.unicode.unicode": {
"required": true
}
},
"form": {
"options.unicode.unicode": {
"type": "input"
},
"options.unicode.unicode1": {
"type": "input"
},
"options.unicode.unicode2": {
"type": "input"
},
"options.unicode.unicode3": {
"type": "input"
},
"null": [
{
"title": "Configurer",
"type": "submit"
}
]
},
"version": "1.0"
}

View File

@ -0,0 +1,15 @@
from tiramisu.option import UnicodeOption, OptionDescription, Leadership
def get_description():
"""generate description for this test
"""
option = UnicodeOption('unicode', "Unicode leader", multi=True)
option1 = UnicodeOption('unicode1', "Unicode follower 1", multi=True)
option2 = UnicodeOption('unicode2', "Unicode follower 2", multi=True)
option3 = UnicodeOption('unicode3', "Unicode follower 3", multi=True)
descr1 = Leadership("unicode", "Common configuration 1",
[option, option1, option2, option3])
descr = OptionDescription("options", "Common configuration 2", [descr1])
descr = OptionDescription("unicode1_leadership", "Leader followers with Unicode", [descr])
return descr

View File

@ -0,0 +1,84 @@
{
"schema": {
"options": {
"properties": {
"options.unicode": {
"properties": {
"options.unicode.unicode": {
"type": "string",
"value": [
"val1",
"val2"
],
"isMulti": true,
"title": "Unicode leader"
},
"options.unicode.unicode1": {
"type": "string",
"isMulti": true,
"title": "Unicode follower 1"
},
"options.unicode.unicode2": {
"type": "string",
"default": "follower2",
"isMulti": true,
"title": "Unicode follower 2 with default multi"
},
"options.unicode.unicode3": {
"type": "string",
"isMulti": true,
"title": "Unicode follower 3"
}
},
"type": "array",
"title": "Common configuration 1"
}
},
"type": "object",
"title": "Common configuration 2"
}
},
"model": {
"options.unicode.unicode": {
"required": true,
"value": [
"val1",
"val2"
],
"owner": "default"
},
"options.unicode.unicode2": {
"0": {
"value": "follower2",
"owner": "default"
},
"1": {
"value": "follower2",
"owner": "default"
}
}
},
"form": {
"options.unicode.unicode": {
"clearable": true,
"type": "input"
},
"options.unicode.unicode1": {
"type": "input"
},
"options.unicode.unicode2": {
"clearable": true,
"type": "input"
},
"options.unicode.unicode3": {
"type": "input"
},
"null": [
{
"title": "Configurer",
"type": "submit"
}
]
},
"version": "1.0"
}

View File

@ -0,0 +1,16 @@
from tiramisu.option import UnicodeOption, OptionDescription
from tiramisu import Leadership
from tiramisu.setting import groups
def get_description():
"""generate description for this test
"""
option = UnicodeOption('unicode', "Unicode leader", ['val1', 'val2'], multi=True)
option1 = UnicodeOption('unicode1', "Unicode follower 1", multi=True)
option2 = UnicodeOption('unicode2', "Unicode follower 2 with default multi", default_multi="follower2", multi=True)
option3 = UnicodeOption('unicode3', "Unicode follower 3", multi=True)
descr1 = Leadership("unicode", "Common configuration 1",
[option, option1, option2, option3])
descr = OptionDescription("options", "Common configuration 2", [descr1])
descr = OptionDescription("unicode1_leadership_default_value", "Leader followers with unicode with default value", [descr])
return descr

View File

@ -0,0 +1,83 @@
{
"schema": {
"options": {
"properties": {
"options.unicode": {
"properties": {
"options.unicode.unicode": {
"type": "string",
"isMulti": true,
"title": "Unicode leader"
},
"options.unicode.unicode1": {
"type": "string",
"isMulti": true,
"title": "Unicode follower 1"
},
"options.unicode.unicode2": {
"type": "string",
"isMulti": true,
"title": "Unicode follower 2 hidden"
},
"options.unicode.unicode3": {
"type": "string",
"isMulti": true,
"title": "Unicode follower 3"
}
},
"type": "array",
"title": "Common configuration"
}
},
"type": "object",
"title": "Common configuration"
}
},
"model": {
"options.unicode.unicode": {
"required": true,
"value": [
"val1",
"val2"
],
"owner": "user"
},
"options.unicode.unicode2": {
"0": {
"display": false,
"hidden": true,
"value": "super",
"owner": "user"
},
"1": {
"display": false,
"hidden": true
},
"null": {
"display": false,
"hidden": true
}
}
},
"form": {
"options.unicode.unicode": {
"type": "input"
},
"options.unicode.unicode1": {
"type": "input"
},
"options.unicode.unicode2": {
"type": "input"
},
"options.unicode.unicode3": {
"type": "input"
},
"null": [
{
"title": "Configurer",
"type": "submit"
}
]
},
"version": "1.0"
}

View File

@ -0,0 +1,25 @@
from tiramisu.option import UnicodeOption, OptionDescription
from tiramisu import Leadership
def get_description():
"""generate description for this test
"""
option = UnicodeOption('unicode', "Unicode leader", multi=True)
option1 = UnicodeOption('unicode1', "Unicode follower 1", multi=True)
option2 = UnicodeOption('unicode2', "Unicode follower 2 hidden", multi=True, properties=('hidden',))
option3 = UnicodeOption('unicode3', "Unicode follower 3", multi=True)
descr1 = Leadership("unicode", "Common configuration",
[option, option1, option2, option3])
descr = OptionDescription("options", "Common configuration", [descr1])
descr = OptionDescription("unicode1_leadership_hidden", "Leader followers with second follower hidden", [descr])
return descr
def get_values(api, allpath=False):
if allpath:
root = 'unicode1_leadership_hidden.'
else:
root = ''
api.option(root + 'options.unicode.unicode').value.set([u'val1', u'val2'])
api.option(root + 'options.unicode.unicode2', 0).value.set(u'super')

View File

@ -0,0 +1,61 @@
{
"schema": {
"options": {
"properties": {
"options.unicode": {
"type": "string",
"title": "Unicode leader"
},
"options.unicode1": {
"properties": {
"options.unicode1.unicode1": {
"type": "string",
"isMulti": true,
"title": "Unicode follower 1"
},
"options.unicode1.unicode2": {
"type": "string",
"isMulti": true,
"title": "Unicode follower 2"
},
"options.unicode1.unicode3": {
"type": "string",
"isMulti": true,
"title": "Unicode follower 3"
}
},
"type": "array",
"title": "Common configuration"
}
},
"type": "object",
"title": "Common configuration"
}
},
"model": {
"options.unicode1.unicode1": {
"required": true
}
},
"form": {
"options.unicode": {
"type": "input"
},
"options.unicode1.unicode1": {
"type": "input"
},
"options.unicode1.unicode2": {
"type": "input"
},
"options.unicode1.unicode3": {
"type": "input"
},
"null": [
{
"title": "Configurer",
"type": "submit"
}
]
},
"version": "1.0"
}

View File

@ -0,0 +1,16 @@
from tiramisu.option import UnicodeOption, OptionDescription
from tiramisu import Leadership
def get_description():
"""generate description for this test
"""
option = UnicodeOption('unicode', "Unicode leader")
option1 = UnicodeOption('unicode1', "Unicode follower 1", multi=True)
option2 = UnicodeOption('unicode2', "Unicode follower 2", multi=True)
option3 = UnicodeOption('unicode3', "Unicode follower 3", multi=True)
descr1 = Leadership("unicode1", "Common configuration",
[option1, option2, option3])
descr = OptionDescription("options", "Common configuration", [option, descr1])
descr = OptionDescription("unicode1_leadership_hidden_all_default", "FIXME...", [descr])
return descr

View File

@ -0,0 +1,72 @@
{
"schema": {
"options": {
"properties": {
"options.unicode": {
"properties": {
"options.unicode.unicode": {
"type": "string",
"isMulti": true,
"title": "Unicode leader"
},
"options.unicode.unicode1": {
"type": "string",
"isMulti": true,
"title": "Unicode follower 1"
},
"options.unicode.unicode2": {
"type": "string",
"isMulti": true,
"title": "Unicode follower 2 not equal"
},
"options.unicode.unicode3": {
"type": "string",
"isMulti": true,
"title": "Unicode follower 3 not equal"
}
},
"type": "array",
"title": "Common configuration 1"
}
},
"type": "object",
"title": "Common configuration 2"
}
},
"model": {
"options.unicode.unicode": {
"required": true
}
},
"form": {
"options.unicode.unicode": {
"type": "input"
},
"options.unicode.unicode1": {
"type": "input"
},
"options.unicode.unicode2": {
"type": "input",
"not_equal": {
"options": [
"options.unicode.unicode3"
]
}
},
"options.unicode.unicode3": {
"type": "input",
"not_equal": {
"options": [
"options.unicode.unicode2"
]
}
},
"null": [
{
"title": "Configurer",
"type": "submit"
}
]
},
"version": "1.0"
}

View File

@ -0,0 +1,17 @@
from tiramisu.option import UnicodeOption, OptionDescription
from tiramisu import Leadership
def get_description():
"""generate description for this test
"""
option = UnicodeOption('unicode', "Unicode leader", multi=True)
option1 = UnicodeOption('unicode1', "Unicode follower 1", multi=True)
option2 = UnicodeOption('unicode2', "Unicode follower 2 not equal", multi=True)
option3 = UnicodeOption('unicode3', "Unicode follower 3 not equal", multi=True)
option2.impl_add_consistency('not_equal', option3)
descr1 = Leadership("unicode", "Common configuration 1",
[option, option1, option2, option3])
descr = OptionDescription("options", "Common configuration 2", [descr1])
descr = OptionDescription("unicode1_leadership_not_equal", "Leader followers with follower not equal", [descr])
return descr

View File

@ -0,0 +1,76 @@
{
"schema": {
"options": {
"properties": {
"options.unicode": {
"properties": {
"options.unicode.unicode": {
"type": "string",
"isMulti": true,
"title": "Unicode leader"
},
"options.unicode.unicode1": {
"type": "string",
"isMulti": true,
"title": "Unicode follower 1"
},
"options.unicode.unicode2": {
"type": "string",
"isMulti": true,
"title": "Values 'test' must show 'Unicode follower 3'"
},
"options.unicode.unicode3": {
"type": "string",
"isMulti": true,
"title": "Unicode follower 3"
}
},
"type": "array",
"title": "Common configuration 1"
}
},
"type": "object",
"title": "Common configuration 2"
}
},
"model": {
"options.unicode.unicode": {
"required": true
}
},
"form": {
"options.unicode.unicode": {
"type": "input"
},
"options.unicode.unicode1": {
"type": "input"
},
"options.unicode.unicode2": {
"type": "input",
"dependencies": {
"default": {
"hide": [
"options.unicode.unicode3"
]
},
"expected": {
"test": {
"show": [
"options.unicode.unicode3"
]
}
}
}
},
"options.unicode.unicode3": {
"type": "input"
},
"null": [
{
"title": "Configurer",
"type": "submit"
}
]
},
"version": "1.0"
}

View File

@ -0,0 +1,20 @@
from tiramisu.option import UnicodeOption, OptionDescription
from tiramisu import Leadership
def get_description():
"""generate description for this test
"""
option = UnicodeOption('unicode', "Unicode leader", multi=True)
option1 = UnicodeOption('unicode1', "Unicode follower 1", multi=True)
option2 = UnicodeOption('unicode2', "Values 'test' must show 'Unicode follower 3'", multi=True)
option3 = UnicodeOption('unicode3', "Unicode follower 3", requires=[{'option': option2,
'expected': u'test',
'action': 'hidden',
'inverse': True}],
multi=True)
descr1 = Leadership("unicode", "Common configuration 1",
[option, option1, option2, option3])
descr = OptionDescription("options", "Common configuration 2", [descr1])
descr = OptionDescription("unicode1_leadership_requires", "Leader followers with Unicode follower 3 hidden when Unicode follower 2 is test", [descr])
return descr

View File

@ -0,0 +1,81 @@
{
"schema": {
"options": {
"properties": {
"options.unicode": {
"type": "string",
"title": "Value 'test' must show Leadership"
},
"options.unicode1": {
"properties": {
"options.unicode1.unicode1": {
"type": "string",
"isMulti": true,
"title": "Unicode leader"
},
"options.unicode1.unicode2": {
"type": "string",
"isMulti": true,
"title": "Unicode follower 1"
},
"options.unicode1.unicode3": {
"type": "string",
"isMulti": true,
"title": "Unicode follower 2"
}
},
"type": "array",
"title": "Common configuration"
}
},
"type": "object",
"title": "Common configuration"
}
},
"model": {
"options.unicode1": {
"properties": [
"hidden"
],
"hidden": true
},
"options.unicode1.unicode1": {
"required": true
}
},
"form": {
"options.unicode": {
"type": "input",
"dependencies": {
"default": {
"hide": [
"options.unicode1"
]
},
"expected": {
"test": {
"show": [
"options.unicode1"
]
}
}
}
},
"options.unicode1.unicode1": {
"type": "input"
},
"options.unicode1.unicode2": {
"type": "input"
},
"options.unicode1.unicode3": {
"type": "input"
},
"null": [
{
"title": "Configurer",
"type": "submit"
}
]
},
"version": "1.0"
}

View File

@ -0,0 +1,19 @@
from tiramisu.option import UnicodeOption, OptionDescription
from tiramisu import Leadership
def get_description():
"""generate description for this test
"""
option = UnicodeOption('unicode', "Value 'test' must show Leadership")
option1 = UnicodeOption('unicode1', "Unicode leader", multi=True)
option2 = UnicodeOption('unicode2', "Unicode follower 1", multi=True)
option3 = UnicodeOption('unicode3', "Unicode follower 2", multi=True)
descr1 = Leadership("unicode1", "Common configuration",
[option1, option2, option3], requires=[{'option': option,
'expected': u'test',
'action': 'hidden',
'inverse': True}])
descr = OptionDescription("options", "Common configuration", [option, descr1])
descr = OptionDescription("unicode1_leadership_requires_all", "Leader follower with requirement", [descr])
return descr

View File

@ -0,0 +1,68 @@
{
"schema": {
"options": {
"properties": {
"options.unicode1": {
"properties": {
"options.unicode1.unicode1": {
"type": "string",
"isMulti": true,
"title": "Values 'test' must show 'Unicode follower 2'"
},
"options.unicode1.unicode2": {
"type": "string",
"isMulti": true,
"title": "Unicode follower 1"
},
"options.unicode1.unicode3": {
"type": "string",
"isMulti": true,
"title": "Unicode follower 2"
}
},
"type": "array",
"title": "Common configuration"
}
},
"type": "object",
"title": "Common configuration"
}
},
"model": {
"options.unicode1.unicode1": {
"required": true
}
},
"form": {
"options.unicode1.unicode1": {
"type": "input",
"dependencies": {
"default": {
"hide": [
"options.unicode1.unicode3"
]
},
"expected": {
"test": {
"show": [
"options.unicode1.unicode3"
]
}
}
}
},
"options.unicode1.unicode2": {
"type": "input"
},
"options.unicode1.unicode3": {
"type": "input"
},
"null": [
{
"title": "Configurer",
"type": "submit"
}
]
},
"version": "1.0"
}

View File

@ -0,0 +1,19 @@
from tiramisu.option import UnicodeOption, OptionDescription
from tiramisu import Leadership
def get_description():
"""generate description for this test
"""
option1 = UnicodeOption('unicode1', "Values 'test' must show 'Unicode follower 2'", multi=True)
option2 = UnicodeOption('unicode2', "Unicode follower 1", multi=True)
option3 = UnicodeOption('unicode3', "Unicode follower 2", multi=True,
requires=[{'option': option1,
'expected': u'test',
'action': 'hidden',
'inverse': True}])
descr1 = Leadership("unicode1", "Common configuration",
[option1, option2, option3])
descr = OptionDescription("options", "Common configuration", [descr1])
descr = OptionDescription("unicode1_leadership_requires_follower", "Leader follower requires follower with leader", [descr])
return descr

View File

@ -0,0 +1,88 @@
{
"schema": {
"options": {
"properties": {
"options.unicode1": {
"properties": {
"options.unicode1.unicode1": {
"type": "string",
"isMulti": true,
"title": "Values 'test' must show 'Unicode follower 2'"
},
"options.unicode1.unicode2": {
"type": "string",
"isMulti": true,
"title": "Unicode follower 1"
},
"options.unicode1.unicode3": {
"type": "string",
"isMulti": true,
"title": "Unicode follower 2"
}
},
"type": "array",
"title": "Common configuration"
}
},
"type": "object",
"title": "Common configuration"
}
},
"model": {
"options.unicode1.unicode1": {
"required": true,
"value": [
"test",
"pas test"
],
"owner": "user"
},
"options.unicode1.unicode2": {
"0": {
"value": "super1",
"owner": "user"
}
},
"options.unicode1.unicode3": {
"0": {
"value": "super1",
"owner": "user"
},
"1": {
"hidden": true
}
}
},
"form": {
"options.unicode1.unicode1": {
"type": "input",
"dependencies": {
"default": {
"hide": [
"options.unicode1.unicode3"
]
},
"expected": {
"test": {
"show": [
"options.unicode1.unicode3"
]
}
}
}
},
"options.unicode1.unicode2": {
"type": "input"
},
"options.unicode1.unicode3": {
"type": "input"
},
"null": [
{
"title": "Configurer",
"type": "submit"
}
]
},
"version": "1.0"
}

View File

@ -0,0 +1,29 @@
from tiramisu.option import UnicodeOption, OptionDescription
from tiramisu import Leadership
def get_description():
"""generate description for this test
"""
option1 = UnicodeOption('unicode1', "Values 'test' must show 'Unicode follower 2'", multi=True)
option2 = UnicodeOption('unicode2', "Unicode follower 1", multi=True)
option3 = UnicodeOption('unicode3', "Unicode follower 2", multi=True,
requires=[{'option': option1,
'expected': u'test',
'action': 'hidden',
'inverse': True}])
descr1 = Leadership("unicode1", "Common configuration",
[option1, option2, option3])
descr = OptionDescription("options", "Common configuration", [descr1])
descr = OptionDescription("unicode1_leadership_requires_follower_value", "Leader follower requires follower with leader value", [descr])
return descr
def get_values(api, allpath=False):
if allpath:
root = 'unicode1_leadership_requires_follower_value.'
else:
root = ''
api.option(root + 'options.unicode1.unicode1').value.set([u'test', u'pas test'])
api.option(root + 'options.unicode1.unicode2', 0).value.set(u'super1')
api.option(root + 'options.unicode1.unicode3', 0).value.set(u'super1')

View File

@ -0,0 +1,68 @@
{
"schema": {
"options": {
"properties": {
"options.unicode1": {
"properties": {
"options.unicode1.unicode1": {
"type": "string",
"isMulti": true,
"title": "Unicode leader"
},
"options.unicode1.unicode2": {
"type": "string",
"isMulti": true,
"title": "Values 'test' must show 'Unicode follower 2'"
},
"options.unicode1.unicode3": {
"type": "string",
"isMulti": true,
"title": "Unicode follower 2"
}
},
"type": "array",
"title": "Common configuration"
}
},
"type": "object",
"title": "Common configuration"
}
},
"model": {
"options.unicode1.unicode1": {
"required": true
}
},
"form": {
"options.unicode1.unicode1": {
"type": "input"
},
"options.unicode1.unicode2": {
"type": "input",
"dependencies": {
"default": {
"hide": [
"options.unicode1.unicode3"
]
},
"expected": {
"test": {
"show": [
"options.unicode1.unicode3"
]
}
}
}
},
"options.unicode1.unicode3": {
"type": "input"
},
"null": [
{
"title": "Configurer",
"type": "submit"
}
]
},
"version": "1.0"
}

View File

@ -0,0 +1,19 @@
from tiramisu.option import UnicodeOption, OptionDescription
from tiramisu import Leadership
def get_description():
"""generate description for this test
"""
option1 = UnicodeOption('unicode1', "Unicode leader", multi=True)
option2 = UnicodeOption('unicode2', "Values 'test' must show 'Unicode follower 2'", multi=True)
option3 = UnicodeOption('unicode3', "Unicode follower 2", multi=True,
requires=[{'option': option2,
'expected': u'test',
'action': 'hidden',
'inverse': True}])
descr1 = Leadership("unicode1", "Common configuration",
[option1, option2, option3])
descr = OptionDescription("options", "Common configuration", [descr1])
descr = OptionDescription("unicode1_leadership_requires_followers", "Leader follower requires follower with a follower", [descr])
return descr

View File

@ -0,0 +1,81 @@
{
"schema": {
"options": {
"properties": {
"options.unicode": {
"type": "string",
"title": "Value 'test' must show leader"
},
"options.unicode1": {
"properties": {
"options.unicode1.unicode1": {
"type": "string",
"isMulti": true,
"title": "Unicode leader"
},
"options.unicode1.unicode2": {
"type": "string",
"isMulti": true,
"title": "Unicode follower 1"
},
"options.unicode1.unicode3": {
"type": "string",
"isMulti": true,
"title": "Unicode follower 2"
}
},
"type": "array",
"title": "Common configuration"
}
},
"type": "object",
"title": "Common configuration"
}
},
"model": {
"options.unicode1": {
"properties": [
"hidden"
],
"hidden": true
},
"options.unicode1.unicode1": {
"required": true
}
},
"form": {
"options.unicode": {
"type": "input",
"dependencies": {
"default": {
"hide": [
"options.unicode1"
]
},
"expected": {
"test": {
"show": [
"options.unicode1"
]
}
}
}
},
"options.unicode1.unicode1": {
"type": "input"
},
"options.unicode1.unicode2": {
"type": "input"
},
"options.unicode1.unicode3": {
"type": "input"
},
"null": [
{
"title": "Configurer",
"type": "submit"
}
]
},
"version": "1.0"
}

View File

@ -0,0 +1,19 @@
from tiramisu.option import UnicodeOption, OptionDescription
from tiramisu import Leadership
def get_description():
"""generate description for this test
"""
option = UnicodeOption('unicode', "Value 'test' must show leader")
option1 = UnicodeOption('unicode1', "Unicode leader", multi=True, requires=[{'option': option,
'expected': u'test',
'action': 'hidden',
'inverse': True}])
option2 = UnicodeOption('unicode2', "Unicode follower 1", multi=True)
option3 = UnicodeOption('unicode3', "Unicode follower 2", multi=True)
descr1 = Leadership("unicode1", "Common configuration",
[option1, option2, option3])
descr = OptionDescription("options", "Common configuration", [option, descr1])
descr = OptionDescription("unicode1_leadership_requires_leader", "Leader follower with requirement on leader", [descr])
return descr

View File

@ -0,0 +1,108 @@
{
"schema": {
"options": {
"properties": {
"options.unicode": {
"properties": {
"options.unicode.unicode": {
"type": "string",
"isMulti": true,
"title": "Values 'test' must show 'Unicode follower 3'"
},
"options.unicode.unicode1": {
"type": "string",
"isMulti": true,
"title": "Unicode follower 1"
},
"options.unicode.unicode2": {
"type": "string",
"isMulti": true,
"title": "Unicode follower 2"
},
"options.unicode.unicode3": {
"type": "string",
"isMulti": true,
"title": "Unicode follower 3"
}
},
"type": "array",
"title": "Common configuration 1"
}
},
"type": "object",
"title": "Common configuration 2"
}
},
"model": {
"options.unicode.unicode": {
"required": true,
"value": [
"test",
"val2"
],
"owner": "user"
},
"options.unicode.unicode1": {
"0": {
"value": "super1",
"owner": "user"
},
"1": {
"value": "super2",
"owner": "user"
}
},
"options.unicode.unicode2": {
"0": {
"value": "pas test",
"owner": "user"
},
"1": {
"value": "test",
"owner": "user"
}
},
"options.unicode.unicode3": {
"1": {
"hidden": true,
"value": "super",
"owner": "user"
}
}
},
"form": {
"options.unicode.unicode": {
"type": "input",
"dependencies": {
"default": {
"hide": [
"options.unicode.unicode3"
]
},
"expected": {
"test": {
"show": [
"options.unicode.unicode3"
]
}
}
}
},
"options.unicode.unicode1": {
"type": "input"
},
"options.unicode.unicode2": {
"type": "input"
},
"options.unicode.unicode3": {
"type": "input"
},
"null": [
{
"title": "Configurer",
"type": "submit"
}
]
},
"version": "1.0"
}

View File

@ -0,0 +1,33 @@
from tiramisu.option import UnicodeOption, OptionDescription
from tiramisu import Leadership
def get_description():
"""generate description for this test
"""
option = UnicodeOption('unicode', "Values 'test' must show 'Unicode follower 3'", multi=True)
option1 = UnicodeOption('unicode1', "Unicode follower 1", multi=True)
option2 = UnicodeOption('unicode2', "Unicode follower 2", multi=True)
option3 = UnicodeOption('unicode3', "Unicode follower 3", requires=[{'option': option,
'expected': u'test',
'action': 'hidden',
'inverse': True}],
multi=True)
descr1 = Leadership("unicode", "Common configuration 1",
[option, option1, option2, option3])
descr = OptionDescription("options", "Common configuration 2", [descr1])
descr = OptionDescription("unicode1_leadership_requires_value", "Leader followers with Unicode follower 3 hidden when Unicode follower 2 is test and modified value", [descr])
return descr
def get_values(api, allpath=False):
if allpath:
root = 'unicode1_leadership_requires_value.'
else:
root = ''
api.option(root + 'options.unicode.unicode').value.set([u'test', u'val2'])
api.option(root + 'options.unicode.unicode1', 0).value.set(u'super1')
api.option(root + 'options.unicode.unicode1', 1).value.set(u'super2')
api.option(root + 'options.unicode.unicode2', 0).value.set(u'pas test')
api.option(root + 'options.unicode.unicode2', 1).value.set(u'test')
api.option(root + 'options.unicode.unicode3', 1).value.set(u'super')

View File

@ -0,0 +1,63 @@
{
"schema": {
"options": {
"properties": {
"options.unicode": {
"properties": {
"options.unicode.unicode": {
"type": "string",
"isMulti": true,
"title": "Unicode leader"
},
"options.unicode.unicode1": {
"type": "string",
"isMulti": true,
"title": "Unicode follower 1"
},
"options.unicode.unicode2": {
"type": "string",
"isMulti": true,
"isSubMulti": true,
"title": "Unicode follower 2 submulti"
},
"options.unicode.unicode3": {
"type": "string",
"isMulti": true,
"title": "Unicode follower 3"
}
},
"type": "array",
"title": "Common configuration 1"
}
},
"type": "object",
"title": "Common configuration 2"
}
},
"model": {
"options.unicode.unicode": {
"required": true
}
},
"form": {
"options.unicode.unicode": {
"type": "input"
},
"options.unicode.unicode1": {
"type": "input"
},
"options.unicode.unicode2": {
"type": "input"
},
"options.unicode.unicode3": {
"type": "input"
},
"null": [
{
"title": "Configurer",
"type": "submit"
}
]
},
"version": "1.0"
}

View File

@ -0,0 +1,17 @@
from tiramisu.option import UnicodeOption, OptionDescription, submulti
from tiramisu import Leadership
def get_description():
"""generate description for this test
"""
option = UnicodeOption('unicode', "Unicode leader", multi=True)
option1 = UnicodeOption('unicode1', "Unicode follower 1", multi=True)
option2 = UnicodeOption('unicode2', "Unicode follower 2 submulti", multi=submulti)
option3 = UnicodeOption('unicode3', "Unicode follower 3", multi=True)
descr1 = Leadership("unicode", "Common configuration 1",
[option, option1, option2, option3])
descr = OptionDescription("options", "Common configuration 2", [descr1])
descr = OptionDescription("unicode1_leadership_submulti", "Leader followers with submulti Unicode", [descr])
return descr

View File

@ -0,0 +1,4 @@
{"options.unicode.unicode": ["val3", "val4"],
"options.unicode.unicode1": ["super1", "super2"],
"options.unicode.unicode2": ["pas test", "test"],
"options.unicode.unicode3": [null, "super"]}

View File

@ -0,0 +1,4 @@
{"options.unicode.unicode": ["val1", "val2"],
"options.unicode.unicode1": [null, null],
"options.unicode.unicode2": ["follower2", "follower2"],
"options.unicode.unicode3": [null, null]}

View File

@ -0,0 +1,4 @@
{"options.unicode.unicode": ["val3"],
"options.unicode.unicode1": ["super1"],
"options.unicode.unicode2": ["pas test"],
"options.unicode.unicode3": [null]}

View File

@ -0,0 +1,4 @@
{"options.unicode.unicode": ["val3", "val4", "val5"],
"options.unicode.unicode1": ["super1", "super2", null],
"options.unicode.unicode2": ["pas test", "test", "follower2"],
"options.unicode.unicode3": [null, "super", null]}

View File

@ -0,0 +1,4 @@
{"options.unicode.unicode": ["val3", "val4", "val5"],
"options.unicode.unicode1": ["super1", "super2", null],
"options.unicode.unicode2": ["pas test", "test", "follower2"],
"options.unicode.unicode3": [null, "super", null]}

View File

@ -0,0 +1,4 @@
{"options.unicode.unicode": ["val3", "val4"],
"options.unicode.unicode1": ["super1", "super2"],
"options.unicode.unicode2": ["pas test", "follower2"],
"options.unicode.unicode3": [null, "super"]}

Some files were not shown because too many files have changed in this diff Show More