chiark / gitweb /
Add version info
authordaid <daid303@gmail.com>
Wed, 11 Apr 2012 14:34:15 +0000 (16:34 +0200)
committerdaid <daid303@gmail.com>
Wed, 11 Apr 2012 14:34:15 +0000 (16:34 +0200)
Cura/gui/mainWindow.py
Cura/gui/simpleMode.py
Cura/util/version.py [new file with mode: 0644]
package.sh

index d81ef925ed1f04c80432b99d4fc786c1d5dec598..c6e7535d51fbf10a442838313ebc69dca6605a0e 100644 (file)
@@ -16,6 +16,7 @@ from gui import printWindow
 from gui import simpleMode
 from gui import icon
 from util import profile
+from util import version
 
 def main():
        app = wx.App(False)
@@ -33,7 +34,7 @@ def main():
 class mainWindow(configBase.configWindowBase):
        "Main user interface window"
        def __init__(self):
-               super(mainWindow, self).__init__(title='Cura')
+               super(mainWindow, self).__init__(title='Cura - ' + version.getVersion())
                
                wx.EVT_CLOSE(self, self.OnClose)
                #self.SetIcon(icon.getMainIcon())
index 4e6262a2219a42b0e280c6f5fff1f74527fa8b8c..777b18623d64f69741cc226b8bd736d1f6d6e1a0 100644 (file)
@@ -13,11 +13,12 @@ from gui import machineCom
 from gui import printWindow
 from gui import icon
 from util import profile
+from util import version
 
 class simpleModeWindow(configBase.configWindowBase):
        "Main user interface window for simple mode"
        def __init__(self):
-               super(simpleModeWindow, self).__init__(title='Cura - Simple mode')
+               super(simpleModeWindow, self).__init__(title='Cura - Simple mode - ' + version.getVersion())
                
                wx.EVT_CLOSE(self, self.OnClose)
                #self.SetIcon(icon.getMainIcon())
diff --git a/Cura/util/version.py b/Cura/util/version.py
new file mode 100644 (file)
index 0000000..98c9ea5
--- /dev/null
@@ -0,0 +1,23 @@
+from __future__ import absolute_import
+import __init__
+
+import os
+
+def getVersion():
+       gitPath = os.path.abspath(os.path.join(os.path.split(os.path.abspath(__file__))[0], "../../.git"))
+       versionFile = os.path.abspath(os.path.join(os.path.split(os.path.abspath(__file__))[0], "../version"))
+       if os.path.exists(gitPath):
+               f = open(gitPath + "/refs/heads/master", "r")
+               version = f.readline()
+               f.close()
+               return version.strip()
+       if os.path.exists(versionFile):
+               f = open(versionFile, "r")
+               version = f.readline()
+               f.close()
+               return version.strip()
+       return "?"
+
+if __name__ == '__main__':
+       print getVersion()
+
index aa94095b2c7234fdd090fda70e5f75b9b01be5a1..af1eb74435d342d7f55e2f31682a71d32a4b8321 100755 (executable)
@@ -16,7 +16,7 @@ BUILD_TARGET=${1:-win32}
 ##Do we need to create the final archive
 ARCHIVE_FOR_DISTRIBUTION=1
 ##Which version name are we appending to the final archive
-BUILD_NAME=RC1
+BUILD_NAME=RC2
 TARGET_DIR=${BUILD_TARGET}-Cura-${BUILD_NAME}
 
 ##Which versions of external programs to use
@@ -140,8 +140,10 @@ mv ${TARGET_DIR}/pypy-*-${BUILD_TARGET} ${TARGET_DIR}/pypy
 #Cleanup pypy
 rm -rf ${TARGET_DIR}/pypy/lib-python/2.7/test
 
-#add Skeinforge
+#add Cura
 cp -a Cura ${TARGET_DIR}/Cura
+#Add cura version file
+echo $BUILD_NAME > ${TARGET_DIR}/Cura/version
 
 #add printrun
 cp -a Printrun ${TARGET_DIR}/Printrun