mirror of
https://github.com/kennethreitz-archive/anyjson.git
synced 2026-06-05 23:20:19 +00:00
Moved stuff into the meta module, fixes #1
Added test_suite thingy to setup.py
This commit is contained in:
+5
-32
@@ -1,35 +1,8 @@
|
||||
"""
|
||||
Wraps the best available JSON implementation available in a common interface
|
||||
"""
|
||||
|
||||
__version__ = "0.2.1"
|
||||
__author__ = "Rune Halvorsen <runefh@gmail.com>"
|
||||
__homepage__ = "http://bitbucket.org/runeh/anyjson/"
|
||||
__docformat__ = "restructuredtext"
|
||||
|
||||
"""
|
||||
|
||||
.. function:: serialize(obj)
|
||||
|
||||
Serialize the object to JSON.
|
||||
|
||||
.. function:: deserialize(str)
|
||||
|
||||
Deserialize JSON-encoded object to a Python object.
|
||||
|
||||
.. function:: force_implementation(name)
|
||||
|
||||
Load a specific json module. This is useful for testing and not much else
|
||||
|
||||
.. attribute:: implementation
|
||||
|
||||
The json implementation object. This is probably not useful to you,
|
||||
except to get the name of the implementation in use. The name is
|
||||
available through `implementation.name`.
|
||||
"""
|
||||
|
||||
from metadata import *
|
||||
import sys
|
||||
|
||||
# explicitly pull in docstring from metadata. see comments there for why.
|
||||
__doc__ = metadata.__doc__
|
||||
implementation = None
|
||||
|
||||
"""
|
||||
@@ -137,5 +110,5 @@ else:
|
||||
else:
|
||||
raise ImportError("No supported JSON module found")
|
||||
|
||||
serialize = lambda value: implementation.serialize(value)
|
||||
deserialize = lambda value: implementation.deserialize(value)
|
||||
serialize = lambda value: implementation.serialize(value)
|
||||
deserialize = lambda value: implementation.deserialize(value)
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
"""Wraps the best available JSON implementation available in a common
|
||||
interface
|
||||
|
||||
.. function:: serialize(obj)
|
||||
|
||||
Serialize the object to JSON.
|
||||
|
||||
.. function:: deserialize(str)
|
||||
|
||||
Deserialize JSON-encoded object to a Python object.
|
||||
|
||||
.. function:: force_implementation(name)
|
||||
|
||||
Load a specific json module. This is useful for testing and not much else
|
||||
|
||||
.. attribute:: implementation
|
||||
|
||||
The json implementation object. This is probably not useful to you,
|
||||
except to get the name of the implementation in use. The name is
|
||||
available through `implementation.name`.
|
||||
"""
|
||||
|
||||
# Note: This module is neccessary so we can load the metadata in setup.py
|
||||
# without risking that the module loading fails. It will fail if the user
|
||||
# has no json module installed, causing ImportError when importing anyjson
|
||||
|
||||
__version__ = "0.2.1"
|
||||
__author__ = "Rune Halvorsen <runefh@gmail.com>"
|
||||
__homepage__ = "http://bitbucket.org/runeh/anyjson/"
|
||||
__docformat__ = "restructuredtext"
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
from setuptools import setup
|
||||
from setuptools import setup, find_packages
|
||||
|
||||
import anyjson
|
||||
author, email = anyjson.__author__[:-1].split(' <')
|
||||
import anyjson.metadata as meta
|
||||
author, email = meta.__author__[:-1].split(' <')
|
||||
|
||||
setup(name='anyjson',
|
||||
version=anyjson.__version__,
|
||||
description=anyjson.__doc__,
|
||||
version=meta.__version__,
|
||||
description=meta.__doc__,
|
||||
long_description=open("README").read(),
|
||||
classifiers=[
|
||||
'License :: OSI Approved :: BSD License',
|
||||
@@ -17,7 +17,8 @@ setup(name='anyjson',
|
||||
author_email=email,
|
||||
url='http://bitbucket.org/runeh/anyjson',
|
||||
license='BSD',
|
||||
py_modules=['anyjson'],
|
||||
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
|
||||
zip_safe=False,
|
||||
platforms=["any"],
|
||||
test_suite = 'nose.collector',
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user