Added a real kofoto.version module instead of generating it. Simpler
authorJoel Rosdahl <joel@rosdahl.net>
Thu, 22 Jul 2004 13:53:16 +0000 (13:53 +0000)
committerJoel Rosdahl <joel@rosdahl.net>
Thu, 22 Jul 2004 13:53:16 +0000 (13:53 +0000)
and less error-prone.

setup.py
src/lib/kofoto/clientenvironment.py
src/lib/kofoto/version.py [new file with mode: 0644]

index 7d6d92f..0403eca 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -3,8 +3,6 @@
 from distutils.core import setup
 import os
 
-version = "0.1"
-
 package_dir = {
     "kofoto": "src/lib/kofoto",
     "gkofoto": "src/gkofoto",
@@ -49,13 +47,12 @@ else:
         "src/cmdline/kofoto",
         ]
 
-f = file("src/lib/kofoto/version.py", "w")
-f.write('version = "%s"' % version)
-f.close()
+versionDict = {}
+execfile("src/lib/kofoto/version.py", versionDict)
 
 setup(
     name="kofoto",
-    version=version,
+    version=versionDict["version"],
     package_dir=package_dir,
     packages=packages,
     scripts=scripts,
@@ -64,5 +61,4 @@ setup(
     author_email="kofoto@rosdahl.net",
     url="http://svn.rosdahl.net/kofoto/kofoto/")
 
-os.unlink("src/lib/kofoto/version.py")
 os.unlink("src/gkofoto/gkofoto")
index 39c43a0..5215de9 100644 (file)
@@ -15,10 +15,7 @@ import sys
 from kofoto.config import *
 from kofoto.shelf import Shelf, FailedWritingError
 from kofoto.imagecache import ImageCache
-try:
-    from kofoto.version import version as kofotoVersion
-except ImportError:
-    kofotoVersion = "development version"
+from kofoto.version import version as kofotoVersion
 
 ######################################################################
 # Public classes.
diff --git a/src/lib/kofoto/version.py b/src/lib/kofoto/version.py
new file mode 100644 (file)
index 0000000..90bc179
--- /dev/null
@@ -0,0 +1 @@
+version = "pre-0.1"