Skip to content

Commit

Permalink
Updated setup-sample.py
Browse files Browse the repository at this point in the history
  • Loading branch information
sundarnagarajan committed Mar 26, 2016
1 parent cfb899a commit 4fd351c
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions setupext/doc/setup-sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@
license = 'License :: OSI Approved :: MIT License'

# The following are optional
try:
long_description = open('README_generated.rst').read()
except:
long_description = description
url = ''
download_url = ''
author = 'Sundar Nagarajan'
Expand Down Expand Up @@ -143,6 +139,19 @@
'''


def get_longdesc(default=''):
'''
Returns-->str
'''
files = ['README.rst', 'README.md', 'README.txt', 'README']
for f in files:
try:
return open(f, 'r').read()
except:
continue
return default


def get_dirtree(topdir, dirlist=[]):
'''
topdir-->str: must be name of a dir under current working dir
Expand Down Expand Up @@ -179,6 +188,8 @@ def get_dirtree(topdir, dirlist=[]):
package_dir = {name: name}
package_data = {name: get_dirtree(topdir=name, dirlist=dirlist)}

long_description = get_longdesc(description)

known_keywords = [
'name', 'version', 'packages', 'description', 'license',
'install_requires', 'requires', 'setup_requires',
Expand Down

0 comments on commit 4fd351c

Please sign in to comment.