Skip to content

Commit

Permalink
Release 1.0.3
Browse files Browse the repository at this point in the history
* Refactored __transform (flask_nemo.__init__) to _transform
* Changed flask.ext.nemo to flask_nemo
* Updated CHANGES.md and setup.py
* Bumped to version 1.0.3
  • Loading branch information
sonofmun authored and PonteIneptique committed May 22, 2018
1 parent cc5af33 commit 398e733
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
7 changes: 7 additions & 0 deletions CHANGES.mD
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Change logs
===

## 1.0.3 - 22/05/2018

By @sonofmun

- Refactored __transform (in flask_nemo.__init__) to _transform. This will make it available to class extensions.
- Changed a single occurrence of "import flask.ext.nemo" in the tests to "import flask_nemo"

## 1.0.2 - 26/01/2017

By @ponteineptique
Expand Down
12 changes: 6 additions & 6 deletions flask_nemo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def __init__(self,

# Reusing self._inventory across requests
self._inventory = None
self.__transform = {
self._transform = {
"default": None
}

Expand All @@ -200,7 +200,7 @@ def __init__(self,
}

if isinstance(transform, dict):
self.__transform.update(transform)
self._transform.update(transform)

self.chunker = {
"default": type(self).default_chunker
Expand Down Expand Up @@ -328,10 +328,10 @@ def transform(self, work, xml, objectId, subreference=None):
:rtype: str
"""
# We check first that we don't have
if str(objectId) in self.__transform:
func = self.__transform[str(objectId)]
if str(objectId) in self._transform:
func = self._transform[str(objectId)]
else:
func = self.__transform["default"]
func = self._transform["default"]

# If we have a string, it means we get a XSL filepath
if isinstance(func, str):
Expand Down Expand Up @@ -955,4 +955,4 @@ def _plugin_endpoint_rename(fn_name, instance):

if instance and instance.namespaced:
fn_name = "r_{0}_{1}".format(instance.name, fn_name[2:])
return fn_name
return fn_name
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from setuptools import setup, find_packages

version = "1.0.2"
version = "1.0.3"

setup(
name='flask_nemo',
Expand Down
2 changes: 1 addition & 1 deletion tests/test_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
greatly tied to the app/blueprint instance
"""
from flask.ext.nemo import Nemo
from flask_nemo import Nemo
from mock import patch, call, Mock
from lxml import etree
from flask import Markup, Flask
Expand Down

0 comments on commit 398e733

Please sign in to comment.