Sophie

Sophie

distrib > Fedora > 16 > i386 > by-pkgid > 668bc5eedcfaa47d59f573de0fe8daed > files > 2

python-mozbase-0-0.3.gitb077641.fc16.src.rpm

diff -up mozilla-mozbase-b077641/mozrunner/mozrunner/runner.py.firefox-version mozilla-mozbase-b077641/mozrunner/mozrunner/runner.py
--- mozilla-mozbase-b077641/mozrunner/mozrunner/runner.py.firefox-version	2012-01-19 14:28:14.000000000 +0100
+++ mozilla-mozbase-b077641/mozrunner/mozrunner/runner.py	2012-01-31 13:24:29.993418894 +0100
@@ -47,6 +47,7 @@ import os
 import platform
 import sys
 import ConfigParser
+import subprocess
 
 from utils import get_metadata_from_egg
 from utils import findInPath
@@ -208,11 +209,15 @@ class FirefoxRunner(Runner):
         Runner.__init__(self, profile, binary, **kwargs)
 
         # Find application version number
-        appdir = os.path.dirname(os.path.realpath(self.binary))
-        appini = ConfigParser.RawConfigParser()
-        appini.read(os.path.join(appdir, 'application.ini'))
+        firefox_args = [os.path.realpath(self.binary), "--version"]
+        firefox_proc = subprocess.Popen(firefox_args, stdout=subprocess.PIPE)
+        firefox_stdout, firefox_stderr = firefox_proc.communicate()
+        version = firefox_stdout.rsplit(" ", 1)[0].rstrip('0123456789pre').rstrip('.')
+        #appdir = os.path.dirname(os.path.realpath(self.binary))
+        #appini = ConfigParser.RawConfigParser()
+        #appini.read(os.path.join(appdir, 'application.ini'))
         # Version needs to be of the form 3.6 or 4.0b and not the whole string
-        version = appini.get('App', 'Version').rstrip('0123456789pre').rstrip('.')
+        #version = appini.get('App', 'Version').rstrip('0123456789pre').rstrip('.')
 
         # Disable compatibility check. See:
         # - http://kb.mozillazine.org/Extensions.checkCompatibility