Commits

anatoly techtonik committed 71f87b6

prepare 0.9, add get_version() helper to setup.py, update ChangeLog

Comments (0)

Files changed (3)

 ChangeLog
 =========
+0.9 (2012-11-13)
+ * it renames file if it already exists
+ * it can be used as a library
+   * download(url) returns filename
+   * bar_adaptive() draws progress bar
+   * bar_thermometer() simplified bar
+
 0.8 (2011-05-03)
  * it detects filename from HTTP headers
 
 Release Checklist
 =================
 
-[ ] update version in setup.py
 [ ] update version in wget.py
 [ ] update ChangeLog in setup.py
 [ ] python setup.py sdist
 from distutils.core import setup
 
+
+def get_version(relpath):
+    """read version info from file without importing it"""
+    from os.path import dirname, join
+    for line in open(join(dirname(__file__), relpath)):
+        if '__version__' in line:
+            if '"' in line:
+                # __version__ = "0.9"
+                return line.split('"')[1]
+            elif "'" in line:
+                return line.split("'")[1]
+
 setup(
     name='wget',
-    version='0.8',
+    version=get_version('wget.py'),
     author='anatoly techtonik <techtonik@gmail.com>',
     url='http://bitbucket.org/techtonik/python-wget/',
 
     long_description= """
 ChangeLog
 =========
+0.9 (2012-11-13)
+ * it renames file if it already exists
+ * it can be used as a library
+   * download(url) returns filename
+   * bar_adaptive() draws progress bar
+   * bar_thermometer() simplified bar
+
 0.8 (2011-05-03)
  * it detects filename from HTTP headers
 
 import math
 
 
-__version__ = "0.9dev"
+__version__ = "0.9"
 
 
 def filename_from_url(url):