diff --git a/setup.py b/setup.py index 5f4224c..1c6a07d 100644 --- a/setup.py +++ b/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", diff --git a/tests/test_json.py b/tests/test_json.py index 0362abf..fdf5711 100644 --- a/tests/test_json.py +++ b/tests/test_json.py @@ -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) diff --git a/tests/test_list.py b/tests/test_list.py index 32bedf5..83a413a 100644 --- a/tests/test_list.py +++ b/tests/test_list.py @@ -1,5 +1,5 @@ from json import loads -from tiramisu_json_api import Config +from tiramisu_api import Config def test_list_option(): diff --git a/tiramisu_json_api/__init__.py b/tiramisu_api/__init__.py similarity index 68% rename from tiramisu_json_api/__init__.py rename to tiramisu_api/__init__.py index eb8cace..70d6a50 100644 --- a/tiramisu_json_api/__init__.py +++ b/tiramisu_api/__init__.py @@ -1,5 +1,5 @@ from .api import Config -__version__ = "0.0.1" +__version__ = "0.1" __all__ = ('Config',) diff --git a/tiramisu_json_api/api.py b/tiramisu_api/api.py similarity index 99% rename from tiramisu_json_api/api.py rename to tiramisu_api/api.py index 2f5f713..e0a34b1 100644 --- a/tiramisu_json_api/api.py +++ b/tiramisu_api/api.py @@ -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())) diff --git a/tiramisu_json_api/error.py b/tiramisu_api/error.py similarity index 100% rename from tiramisu_json_api/error.py rename to tiramisu_api/error.py diff --git a/tiramisu_json_api/i18n.py b/tiramisu_api/i18n.py similarity index 100% rename from tiramisu_json_api/i18n.py rename to tiramisu_api/i18n.py diff --git a/tiramisu_json_api/setting.py b/tiramisu_api/setting.py similarity index 100% rename from tiramisu_json_api/setting.py rename to tiramisu_api/setting.py