Skip to content

Commit

Permalink
added automatic markdown to rst conversion for pypi release
Browse files Browse the repository at this point in the history
  • Loading branch information
devsnd committed Sep 19, 2014
1 parent e3cb47d commit 5c2b944
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
8 changes: 5 additions & 3 deletions README.md
Expand Up @@ -20,9 +20,11 @@ current features:
You can find more information on the [CherryMusic website](http://www.fomori.org/cherrymusic)
and in our [wiki](https://github.com/devsnd/cherrymusic/wiki).

master | devel
--- | ---
[![Build Status](https://travis-ci.org/devsnd/cherrymusic.png?branch=master)](https://travis-ci.org/devsnd/cherrymusic) | [![Build Status](https://travis-ci.org/devsnd/cherrymusic.png?branch=devel)](https://travis-ci.org/devsnd/cherrymusic)
master: [![Build Status Master](https://travis-ci.org/devsnd/cherrymusic.png?branch=master)](https://travis-ci.org/devsnd/cherrymusic)

devel: [![Build Status Devel](https://travis-ci.org/devsnd/cherrymusic.png?branch=devel)](https://travis-ci.org/devsnd/cherrymusic)





Expand Down
17 changes: 16 additions & 1 deletion setup.py 100644 → 100755
Expand Up @@ -3,6 +3,7 @@
except ImportError:
from distutils.core import setup
import os
import sys
import codecs
import cherrymusicserver
from cherrymusicserver import pathprovider
Expand Down Expand Up @@ -76,7 +77,21 @@ def packagedata(pkgfolder, childpath=''):
# files to put in /usr/share
data_files = listFilesRec('res',shareFolder)

long_description = "\n" + "\n".join([read('README.md')])
long_description = None
if 'upload' in sys.argv:
readmemd = "\n" + "\n".join([read('README.md')])
print("converting markdown to reStucturedText for upload to pypi.")
from urllib.request import urlopen
from urllib.parse import quote
import json

url = 'http://johnmacfarlane.net/cgi-bin/trypandoc?text=%s&from=markdown&to=rst'
urlhandler = urlopen(url % quote(readmemd))
result = json.loads(codecs.decode(urlhandler.read(), 'utf-8'))

long_description = result['result']
else:
long_description = "\n" + "\n".join([read('README.md')])

setup_options = {
'name': 'CherryMusic',
Expand Down

0 comments on commit 5c2b944

Please sign in to comment.