[pitivi/ges] When run from git, don't show a stable version number in About



commit 2df0743bf512eff2ba9976643af361cbe5ae2ac6
Author: Jean-FranÃois Fortin Tam <nekohayo gmail com>
Date:   Wed Apr 4 21:49:33 2012 -0400

    When run from git, don't show a stable version number in About

 pitivi/mainwindow.py |    6 +++++-
 pitivi/utils/misc.py |   12 ++++++++++++
 2 files changed, 17 insertions(+), 1 deletions(-)
---
diff --git a/pitivi/mainwindow.py b/pitivi/mainwindow.py
index bbebd70..120154e 100644
--- a/pitivi/mainwindow.py
+++ b/pitivi/mainwindow.py
@@ -37,6 +37,7 @@ from gtk import RecentManager
 from hashlib import md5
 
 from pitivi.utils.loggable import Loggable
+from pitivi.utils.misc import in_devel
 from pitivi.settings import GlobalSettings
 from pitivi.effects import EffectListWidget
 from pitivi.medialibrary import MediaLibraryWidget, MediaLibraryError
@@ -615,7 +616,10 @@ class PitiviMainWindow(gtk.Window, Loggable):
     def _aboutCb(self, unused_action):
         abt = gtk.AboutDialog()
         abt.set_name(APPNAME)
-        abt.set_version(pitivi_version)
+        if in_devel:
+            abt.set_version("git")
+        else:
+            abt.set_version(pitivi_version)
         gtk.about_dialog_set_url_hook(self._showWebsiteCb)
         abt.set_website(APPURL)
         ges_version_str = "GES %i.%i.%i.%i" % (ges.version())
diff --git a/pitivi/utils/misc.py b/pitivi/utils/misc.py
index ddff098..45e2e4b 100644
--- a/pitivi/utils/misc.py
+++ b/pitivi/utils/misc.py
@@ -88,6 +88,18 @@ def bin_contains(bin, element):
     return False
 
 
+def in_devel():
+    """
+    Returns True if the current PiTiVi instance is run from a git checkout
+    """
+    try:
+        # This code is the same as in the configure files
+        rd = '/'.join(os.path.dirname(os.path.abspath(__file__)).split('/')[:-1])
+        return os.path.exists(os.path.join(rd, '.git'))
+    except:
+        return False
+
+
 #------------------------------ URI helpers   --------------------------------#
 def isWritable(path):
     """Check if the file/path is writable"""



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]