From 83c741755624cd255272380ff748f760c8d41c15 Mon Sep 17 00:00:00 2001
From: Mike Bayer <mike_mp@zzzcomputing.com>
Date: Sun, 28 Jun 2009 15:30:41 +0000
Subject: [PATCH] - added "mako.__version__" attribute to   the base module. 
 [ticket:110]

---
 CHANGES              | 3 +++
 doc/build/genhtml.py | 3 +--
 lib/mako/__init__.py | 3 +++
 setup.py             | 8 ++++++--
 4 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/CHANGES b/CHANGES
index 001e8d0..a8e2ca2 100644
--- a/CHANGES
+++ b/CHANGES
@@ -29,6 +29,9 @@
   was causing tags to compile with 
   case-insensitive names, thus messing up
   custom <%call> names. [ticket:108]
+
+- added "mako.__version__" attribute to
+  the base module.  [ticket:110]
   
 0.2.4
 - Fixed compatibility with Jython 2.5b1.
diff --git a/doc/build/genhtml.py b/doc/build/genhtml.py
index 59eb6eb..5c8431c 100644
--- a/doc/build/genhtml.py
+++ b/doc/build/genhtml.py
@@ -5,7 +5,7 @@ import cPickle as pickle
 sys.path = ['../../lib', './lib/'] + sys.path
 
 from mako.lookup import TemplateLookup
-from mako import exceptions
+from mako import exceptions, __version__ as version
 
 import read_markdown, toc
 
@@ -24,7 +24,6 @@ files = [
     ]
 
 title='Mako Documentation'
-version = '0.2.3'
 
 root = toc.TOCElement('', 'root', '', version=version, doctitle=title)
 
diff --git a/lib/mako/__init__.py b/lib/mako/__init__.py
index adced7f..43cb853 100644
--- a/lib/mako/__init__.py
+++ b/lib/mako/__init__.py
@@ -4,3 +4,6 @@
 # This module is part of Mako and is released under
 # the MIT License: http://www.opensource.org/licenses/mit-license.php
 
+
+__version__ = '0.2.5'
+
diff --git a/setup.py b/setup.py
index a3f125a..1b1184d 100644
--- a/setup.py
+++ b/setup.py
@@ -1,9 +1,13 @@
 from setuptools import setup, find_packages
+import os
+import re
 
-version = '0.2.5'
+v = file(os.path.join(os.path.dirname(__file__), 'lib', 'mako', '__init__.py'))
+VERSION = re.compile(r".*__version__ = '(.*?)'", re.S).match(v.read()).group(1)
+v.close()
 
 setup(name='Mako',
-      version=version,
+      version=VERSION,
       description="A super-fast templating language that borrows the \
  best ideas from the existing templating languages.",
       long_description="""\
-- 
GitLab