Skip to content

Commit

Permalink
Use pypandoc
Browse files Browse the repository at this point in the history
  • Loading branch information
jrief committed Dec 21, 2015
1 parent 1a1539f commit 7e1043b
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
import os
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from setuptools import setup, find_packages
from ws4redis import __version__
try:
from pypandoc import convert
except ImportError:
import io

def convert(filename, fmt):
with io.open(filename, encoding='utf-8') as fd:
return fd.read()

DESCRIPTION = 'Websocket support for Django using Redis as datastore'

Expand All @@ -22,19 +33,13 @@
'Programming Language :: Python :: 3.4',
]


def read(fname):
readme_file = os.path.join(os.path.dirname(__file__), fname)
return os.popen('[ -x "$(which pandoc 2>/dev/null)" ] && pandoc -t rst {0} || cat {0}'.format(readme_file)).read()


setup(
name='django-websocket-redis',
version=__version__,
author='Jacob Rief',
author_email='jacob.rief@gmail.com',
description=DESCRIPTION,
long_description=read('README.md'),
long_description=convert('README.md', 'rst'),
url='https://github.com/jrief/django-websocket-redis',
license='MIT',
keywords=['django', 'websocket', 'redis'],
Expand Down

0 comments on commit 7e1043b

Please sign in to comment.