add version module, currently just harcoded info
authorTero Marttila <terom@fixme.fi>
Mon, 15 Jun 2009 01:36:15 +0300
changeset 124 cac613118e75
parent 123 31c4a328ef96
child 125 74f135774567
add version module, currently just harcoded info
degal/gallery.py
degal/main.py
degal/templates.py
degal/version.py
--- a/degal/gallery.py	Mon Jun 15 00:29:43 2009 +0300
+++ b/degal/gallery.py	Mon Jun 15 01:36:15 2009 +0300
@@ -57,10 +57,3 @@
 
         return stylesheet
 
-    @lazy_load
-    def version (self) :
-        """
-            Return version string
-        """
-
-        return "???"
--- a/degal/main.py	Mon Jun 15 00:29:43 2009 +0300
+++ b/degal/main.py	Mon Jun 15 01:36:15 2009 +0300
@@ -2,7 +2,7 @@
     Main entry point for the command-line interface
 """
 
-import gallery, commands, config
+import gallery, commands, config, version
 
 from optparse import OptionParser
 import os.path
@@ -19,7 +19,7 @@
         Build the OptionParser that we use
     """
     
-    parser = OptionParser(prog=exec_name, description="Degal - A photo gallery", version="???")
+    parser = OptionParser(prog=exec_name, description="Degal - A photo gallery", version="Degal %s" % version.VERSION_STRING)
     
     parser.add_option('-C', "--config",         metavar='PATH', dest="_load_config_path",
             help="Load configuration from PATH")
--- a/degal/templates.py	Mon Jun 15 00:29:43 2009 +0300
+++ b/degal/templates.py	Mon Jun 15 01:36:15 2009 +0300
@@ -2,7 +2,7 @@
     Templates for HTML output
 """
 
-import html
+import html, version
 from html import tags
 
 def link_from (source, target) :
@@ -182,7 +182,12 @@
             body,
             
             # footer
-            tags.p(id='about')(tags.a(href='http://projects.qmsk.net/degal')('Degal'), gallery.version)
+            tags.p(id='about')(
+                "Generated using",
+                tags.a(href='http://projects.qmsk.net/degal')('Degal'), 
+                "version",
+                tags.a(href=version.VERSION_URL)(version.VERSION_STRING),
+            )
         ],
     )
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/degal/version.py	Mon Jun 15 01:36:15 2009 +0300
@@ -0,0 +1,8 @@
+"""
+    Figure out the current version
+"""
+
+# XXX: hardcoded
+VERSION_STRING  = "0.9"
+VERSION_URL     = "http://projects.qmsk.net/degal"
+