Skip to content

Commit

Permalink
Merge branch 'release/1.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
timothycrosley committed May 17, 2016
2 parents 1137d23 + 6938335 commit 246bb68
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .env
Expand Up @@ -16,7 +16,7 @@ fi

export PROJECT_NAME=$OPEN_PROJECT_NAME
export PROJECT_DIR="$PWD"
export PROJECT_VERSION="1.0.0"
export PROJECT_VERSION="1.1.0"

if [ ! -d "venv" ]; then
if ! hash pyvenv 2>/dev/null; then
Expand Down
5 changes: 4 additions & 1 deletion CHANGELOG.md
@@ -1,5 +1,8 @@
Changelog
=========

### 0.0.1
### 1.1.0
- Updated input formatter to be compatible with hug 2.1.0 specification

### 1.0.0
- Initial Release
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -13,7 +13,7 @@ An extension for hug that provides YAML input formats, output formats, and docum
import hug
import hug_yaml

hug.API(__name__).extend(input_format)
hug.API(__name__).extend(hug_yaml.input_format)


@hug.not_found(output=hug_yaml.output)
Expand Down
2 changes: 1 addition & 1 deletion hug_yaml/_version.py
Expand Up @@ -19,4 +19,4 @@
OTHER DEALINGS IN THE SOFTWARE.
"""
current = "1.0.0"
current = "1.1.0"
12 changes: 6 additions & 6 deletions hug_yaml/input_format.py
Expand Up @@ -23,18 +23,18 @@
import yaml


def convert(data, encoding='utf-8', safe=True):
def convert(data, charset='utf-8', safe=True):
"""Converts the YAML data into a Python Data structure: if safe is set to False YAML object loading is possible"""
return (yaml.safe_load if safe else yaml.load)(data.read().decode(encoding))
return (yaml.safe_load if safe else yaml.load)(data.read().decode(charset))


@hug.default_input_format('text/yaml')
def text_yaml(data, encoding='utf-8'):
def text_yaml(data, **kwargs):
"""Converts a `text/yaml` YAML request into a Python Data structure"""
return convert(data, encoding)
return convert(data, **kwargs)


@hug.default_input_format('application/x-yaml')
def application_yaml(data, encoding='utf-8'):
def application_yaml(data, **kwargs):
"""Converts an `application/x-yaml` YAML request into a Python Data structure"""
return convert(data, encoding)
return convert(data, **kwargs)
2 changes: 1 addition & 1 deletion requirements/common.txt
@@ -1,2 +1,2 @@
PyYAML==3.11
hug==2.0.6
hug==2.1.0
4 changes: 2 additions & 2 deletions setup.py
Expand Up @@ -82,7 +82,7 @@ def run_tests(self):
readme = ''

setup(name='hug_yaml',
version='1.0.0',
version='1.1.0',
description='An extension for hug that provides YAML input formats, output formats, and documentation.',
long_description=readme,
author='Timothy Crosley',
Expand All @@ -91,7 +91,7 @@ def run_tests(self):
license="MIT",
packages=['hug_yaml'],
requires=['PyYAML', 'hug'],
install_requires=['PyYAML', 'hug'],
install_requires=['PyYAML', 'hug>=2.1.0'],
cmdclass=cmdclass,
ext_modules=ext_modules,
keywords='Python, Python3',
Expand Down

0 comments on commit 246bb68

Please sign in to comment.