[prev in list] [next in list] [prev in thread] [next in thread] 

List:       klik-devel
Subject:    [klik-devel] [klikclient commit] r1440 -
From:       codesite-noreply () google ! com
Date:       2008-03-24 23:11:14
Message-ID: 0016e644d6c8044936f3d90dd0cce29e () google ! com
[Download RAW message or body]

Author: KillerKiwi2005
Date: Mon Mar 24 16:10:41 2008
New Revision: 1440

Modified:
   trunk/client/trunk/klikclient/lib/klik/utils/xdg.py

Log:
Regular expression love.. we now get base system version numbers

Modified: trunk/client/trunk/klikclient/lib/klik/utils/xdg.py
==============================================================================
--- trunk/client/trunk/klikclient/lib/klik/utils/xdg.py	(original)
+++ trunk/client/trunk/klikclient/lib/klik/utils/xdg.py	Mon Mar 24 
16:10:41 2008
@@ -300,7 +300,8 @@
 		result.append("PYTHON")
 		
  		if len(Popen(["which", "gnome-about"], stdout=PIPE, 
stderr=open(os.devnull, "w")).communicate()[0].strip()) > 0:
-			result.append("GNOME")
+			version = re.search("\d+(\.\d+)+", 
Popen(["gnome-about", "--version"], stdout=PIPE, stderr=open(os.devnull, \
"w")).communicate()[0].strip()).group() +			result.append("GNOME " + version)
 			
 		if self.get_is_gtk_installed():
 			result.append("GTK")
@@ -308,26 +309,36 @@
  		if len(Popen(["which", "kde-config"], stdout=PIPE, 
stderr=open(os.devnull, "w")).communicate()[0].strip()) > 0:
 			try:
  				if Popen(["kde-config" ,"--version"], stdout=PIPE, 
stderr=open(os.devnull, "w")).communicate()[0].strip().count("KDE") > 0:
-					result.append("KDE")
+					text = Popen(["kde-config" ,"--version"], stdout=PIPE, \
stderr=STDOUT).communicate()[0].strip() +					version = re.search("(?<=KDE\: \
)\d+(\.\d+)+", text).group() +					result.append("KDE " + version)
 		
  				if Popen(["kde-config" ,"--version"], stdout=PIPE, 
stderr=open(os.devnull, "w")).communicate()[0].strip().count("Qt: 3.") 
> 0:
-					result.append("QT3")
+					text = Popen(["kde-config" ,"--version"], stdout=PIPE, \
stderr=STDOUT).communicate()[0].strip() +					version = re.search("(?<=Qt\: \
)\d+(\.\d+)+", text).group() +					result.append("QT3 " + version)
 		
  				if Popen(["kde-config" ,"--version"], stdout=PIPE, 
stderr=open(os.devnull, "w")).communicate()[0].strip().count("Qt: 4.") 
> 0:
-					result.append("QT4")
+					text = Popen(["kde-config" ,"--version"], stdout=PIPE, \
stderr=STDOUT).communicate()[0].strip() +					version = re.search("(?<=Qt\: \
)\d+(\.\d+)+", text).group() +					result.append("QT4 " + version)
 			except:
 				pass
  		# Every thing after here is being collected out of intrest.. we are 
not filtering based on these
 		# Although we may do in the future
 		
  		if len(Popen(["which", "mono"], stdout=PIPE, 
stderr=open(os.devnull, "w")).communicate()[0].strip()) > 0:
-			result.append("MONO")
+			version = re.search("\d+(\.\d+)+", Popen(["mono", "--version"], 
stdout=PIPE, stderr=open(os.devnull, "w")).communicate()[0].strip()).group()
+			result.append("MONO " + version)
 		
  		if len(Popen(["which", "java"], stdout=PIPE, 
stderr=open(os.devnull, "w")).communicate()[0].strip()) > 0:
-			result.append("JAVA")
+			text = Popen(["java", "-version"], stdout=PIPE, \
stderr=STDOUT).communicate()[0].strip() +			version = re.search("\d+(\.\d+)+", \
text).group() +			result.append("JAVA " + version)
 			
  		if len(Popen(["which", "wine"], stdout=PIPE, 
stderr=open(os.devnull, "w")).communicate()[0].strip()) > 0:
-			result.append("WINE")
+			version = re.search("\d+(\.\d+)+", Popen(["wine", "--version"], 
stdout=PIPE, stderr=STDOUT).communicate()[0].strip()).group()
+			result.append("WINE " + version)
 			
 		return (result)
 		
_______________________________________________
klik-devel mailing list
klik-devel@kde.org
https://mail.kde.org/mailman/listinfo/klik-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic