diff options
| author | Kenneth Reitz <me@kennethreitz.com> | 2010-10-06 13:42:26 -0400 |
|---|---|---|
| committer | Kenneth Reitz <me@kennethreitz.com> | 2010-10-06 13:42:26 -0400 |
| commit | a54949bc08e7323bb7b276d8b8acd7ab0ec5a397 (patch) | |
| tree | 41854dc9a0e0aa1073a2516110b657525ce748e7 | |
| parent | ed686c23914d42dec69fcc9e8e8fc52a727095eb (diff) | |
| download | tablib-a54949bc08e7323bb7b276d8b8acd7ab0ec5a397.tar.gz | |
Removed external dependencies, but utilize them if
available.
| -rw-r--r-- | setup.py | 9 | ||||
| -rw-r--r-- | tablib/formats/_json.py | 4 | ||||
| -rw-r--r-- | tablib/formats/_xls.py | 6 | ||||
| -rw-r--r-- | tablib/formats/_yaml.py | 4 |
4 files changed, 16 insertions, 7 deletions
@@ -15,6 +15,11 @@ if sys.argv[-1] == "publish": publish() sys.exit() +required = [] + +if sys.version_info < (2, 6): + required.append('simplejson') + setup( name='tablib', version='0.8.4', @@ -24,8 +29,8 @@ setup( author='Kenneth Reitz', author_email='me@kennethreitz.com', url='http://github.com/kennethreitz/tablib', - packages=['tablib', 'tablib.formats'], - install_requires=['xlwt', 'simplejson', 'PyYAML'], + packages=['tablib', 'tablib.formats', 'tablib.packages.yaml', 'tablib.packages.xlwt'], + install_requires=required, license='MIT', classifiers=( 'Development Status :: 5 - Production/Stable', diff --git a/tablib/formats/_json.py b/tablib/formats/_json.py index 843da90..5619316 100644 --- a/tablib/formats/_json.py +++ b/tablib/formats/_json.py @@ -4,9 +4,9 @@ """ try: - import json + import json except ImportError: - import simplejson as json + import simplejson as json import tablib.core diff --git a/tablib/formats/_xls.py b/tablib/formats/_xls.py index f7be4a4..97a9580 100644 --- a/tablib/formats/_xls.py +++ b/tablib/formats/_xls.py @@ -3,9 +3,13 @@ """ Tablib - XLS Support. """ -import xlwt import cStringIO +try: + import xlwt +except ImportError: + import tablib.packages.xlwt as xlwt + title = 'xls' extentions = ('xls',) diff --git a/tablib/formats/_yaml.py b/tablib/formats/_yaml.py index ab96b61..59d49a0 100644 --- a/tablib/formats/_yaml.py +++ b/tablib/formats/_yaml.py @@ -4,9 +4,9 @@ """ try: - import yaml + import yaml except ImportError: - import tablib.packages.yaml as yaml + import tablib.packages.yaml as yaml import tablib |
