tiramisu_json_api => tiramisu_api
This commit is contained in:
parent
f2d5ad4f30
commit
5722fbfaa8
10
setup.py
10
setup.py
|
@ -3,17 +3,17 @@
|
|||
|
||||
from setuptools import setup, find_packages
|
||||
|
||||
import tiramisu_json_api
|
||||
import tiramisu_api
|
||||
|
||||
setup(
|
||||
name='tiramisu_json_api',
|
||||
version=tiramisu_json_api.__version__,
|
||||
name='tiramisu_api',
|
||||
version=tiramisu_api.__version__,
|
||||
packages=find_packages(),
|
||||
author="Emmanuel Garette & Tiramisu Team",
|
||||
description="A subset of Tiramisu API that works remotly with tiramisu-json",
|
||||
description="A subset of Tiramisu API.",
|
||||
long_description=open('README.md').read(),
|
||||
include_package_data=True,
|
||||
url='https://framagit.org/tiramisu/tiramisu-json-api',
|
||||
url='https://framagit.org/tiramisu/tiramisu-api-python',
|
||||
|
||||
classifiers=[
|
||||
"Programming Language :: Python",
|
||||
|
|
|
@ -6,9 +6,9 @@ import pytest
|
|||
# import warnings
|
||||
|
||||
# from tiramisu.error import ValueWarning
|
||||
from tiramisu_json_api import Config
|
||||
from tiramisu_json_api.error import PropertiesOptionError
|
||||
from tiramisu_json_api.setting import undefined
|
||||
from tiramisu_api import Config
|
||||
from tiramisu_api.error import PropertiesOptionError
|
||||
from tiramisu_api.setting import undefined
|
||||
|
||||
|
||||
# warnings.simplefilter("always", ValueWarning)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
from json import loads
|
||||
from tiramisu_json_api import Config
|
||||
from tiramisu_api import Config
|
||||
|
||||
|
||||
def test_list_option():
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
from .api import Config
|
||||
|
||||
__version__ = "0.0.1"
|
||||
__version__ = "0.1"
|
||||
__all__ = ('Config',)
|
||||
|
|
@ -9,7 +9,7 @@ from .setting import undefined
|
|||
from .i18n import _
|
||||
|
||||
|
||||
TIRAMISU_JSON_VERSION = '1.0'
|
||||
TIRAMISU_FORMAT = '1.0'
|
||||
DEBUG = False
|
||||
|
||||
|
||||
|
@ -637,22 +637,22 @@ class ContextValue(_Value):
|
|||
class Config:
|
||||
# config
|
||||
def __init__(self,
|
||||
json):
|
||||
dico):
|
||||
if DEBUG:
|
||||
from pprint import pprint
|
||||
pprint(json)
|
||||
if json.get('version') != TIRAMISU_JSON_VERSION:
|
||||
raise Exception('incompatible tiramisu-json format version (got {}, expected {})'.format(json.get('version', '0.0'), TIRAMISU_JSON_VERSION))
|
||||
self.model = json.get('model')
|
||||
self.global_model = json.get('global')
|
||||
self.form = json.get('form')
|
||||
pprint(dico)
|
||||
if dico.get('version') != TIRAMISU_FORMAT:
|
||||
raise Exception('incompatible version of tiramisu (got {}, expected {})'.format(dico.get('version', '0.0'), TIRAMISU_FORMAT))
|
||||
self.model = dico.get('model')
|
||||
self.global_model = dico.get('global')
|
||||
self.form = dico.get('form')
|
||||
# support pattern
|
||||
if self.form:
|
||||
for key, option in self.form.items():
|
||||
if key != 'null' and 'pattern' in option:
|
||||
option['pattern'] = re.compile(option['pattern'])
|
||||
self.temp = {}
|
||||
self.schema = json.get('schema')
|
||||
self.schema = dico.get('schema')
|
||||
self.updates = []
|
||||
if self.schema:
|
||||
first_path = next(iter(self.schema.keys()))
|
Loading…
Reference in New Issue