Permalink
Browse files

De-duplicate the README and version number.

  • Loading branch information...
1 parent 3570b59 commit 34d6fc35610fed94e9ee3e71dcf9418c18ca7a83 @SimonSapin SimonSapin committed Oct 1, 2012
Showing with 30 additions and 27 deletions.
  1. +10 −2 README
  2. +8 −5 docs/conf.py
  3. +3 −0 flask_flatpages/__init__.py
  4. +9 −20 setup.py
View
12 README
@@ -1,8 +1,16 @@
Flask-FlatPages
---------------
-Provides flat static pages to a Flask application, based on text files
+Provides flat static pages to a Flask_ application, based on text files
as opposed to a relationnal database.
+* BSD licensed
+* Latest documentation `on python.org`_
+* Source, issues and pull requests `on Github`_
+* Releases `on PyPI`_
+* Install with ``pip install Flask-FlatPages``
-See documentation: http://packages.python.org/Flask-FlatPages
+.. _Flask: http://flask.pocoo.org/
+.. _on python.org: http://packages.python.org/Flask-FlatPages/
+.. _on Github: https://github.com/SimonSapin/Flask-FlatPages/
+.. _on PyPI: http://pypi.python.org/pypi/Flask-FlatPages
View
@@ -11,7 +11,7 @@
# All configuration values have a default; values that are commented out
# serve to show the default.
-import sys, os
+import sys, os, re
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
@@ -49,12 +49,15 @@
# |version| and |release|, also used in various other places throughout the
# built documents.
#
-# The short X.Y version.
-#version = '0.1'
-version = '0.3'
# The full version, including alpha/beta/rc tags.
#release = '0.1dev'
-release = version
+release = re.search("VERSION = '([^']+)'", open(os.path.join(
+ os.path.dirname(__file__), '..', 'flask_flatpages', '__init__.py'
+)).read()).group(1)
+
+# The short X.Y version.
+#version = '0.1'
+version = re.split('[a-zA-Z]', release)[0]
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
@@ -21,6 +21,9 @@
import flask
+VERSION = '0.4'
+
+
def pygmented_markdown(text):
"""Render Markdown text to HTML. Uses the `Codehilite`_ extension
if `Pygments`_ is available.
View
@@ -1,34 +1,23 @@
-"""
-Flask-FlatPages
----------------
-
-Provides flat static pages to a Flask_ application, based on text files
-as opposed to a relationnal database.
-
-* BSD licensed
-* Latest documentation `on python.org`_
-* Source, issues and pull requests `on Github`_
-* Releases `on PyPI`_
-* Install with ``pip install Flask-FlatPages``
+import re
+import os.path
+from setuptools import setup, find_packages
-.. _Flask: http://flask.pocoo.org/
-.. _on python.org: http://packages.python.org/Flask-FlatPages/
-.. _on Github: https://github.com/SimonSapin/Flask-FlatPages/
-.. _on PyPI: http://pypi.python.org/pypi/Flask-FlatPages
-"""
+ROOT = os.path.dirname(__file__)
+README = open(os.path.join(ROOT, 'README')).read()
+INIT_PY = open(os.path.join(ROOT, 'flask_flatpages', '__init__.py')).read()
+VERSION = re.search("VERSION = '([^']+)'", INIT_PY).group(1)
-from setuptools import setup, find_packages
setup(
name='Flask-FlatPages',
- version='0.3', # also change this in docs/conf.py
+ version=VERSION,
url='https://github.com/SimonSapin/Flask-FlatPages',
license='BSD',
author='Simon Sapin',
author_email='simon.sapin@exyr.org',
description='Provides flat static pages to a Flask application',
- long_description=__doc__,
+ long_description=README,
packages=find_packages(),
# test pages
package_data={'': ['pages*/*.*', 'pages/*/*.*', 'pages/*/*/*.*']},

0 comments on commit 34d6fc3

Please sign in to comment.