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

List:       klik-devel
Subject:    [klik-devel] [klikclient commit] r1241 -
From:       codesite-noreply () google ! com
Date:       2008-02-26 20:28:03
Message-ID: 00163646d8f20447158682aa193684b5 () google ! com
[Download RAW message or body]

Author: KillerKiwi2005
Date: Tue Feb 26 12:27:20 2008
New Revision: 1241

Modified:
   trunk/client/trunk/klikclient/lib/klik/base.py
   trunk/client/trunk/klikclient/lib/klik/cmg.py
   trunk/client/trunk/klikclient/lib/klik/integration.py

Log:
Fixs for integration.py

Modified: trunk/client/trunk/klikclient/lib/klik/base.py
==============================================================================
--- trunk/client/trunk/klikclient/lib/klik/base.py	(original)
+++ trunk/client/trunk/klikclient/lib/klik/base.py	Tue Feb 26 12:27:20 2008
@@ -398,6 +398,10 @@
 		cmg = KlikCmg(self, cmg_path)
 		return cmg.execute(command, args)

+	def is_valid_cmg(self, cmg_path):
+		cmg = KlikCmg(self, cmg_path)
+		return cmg.is_valid_cmg()
+

 	# Private methods
 	def __download_progress(self, percentage, text):
@@ -432,10 +436,7 @@
 		cmg = KlikCmg(self, cmg_path)
 		return cmg.extract_icon(file_path_to, image_size )

-	# MOVE TO cmg.py
-	def is_valid_cmg(self, path):
-		print "ERROR is_valid_cmg moved to cmg.py"
-		return
+

 	# MOVE TO cmg.py
 	def is_klik2_cmg(self, path):

Modified: trunk/client/trunk/klikclient/lib/klik/cmg.py
==============================================================================
--- trunk/client/trunk/klikclient/lib/klik/cmg.py	(original)
+++ trunk/client/trunk/klikclient/lib/klik/cmg.py	Tue Feb 26 12:27:20 2008
@@ -196,7 +196,7 @@
 								return self.__cmg_version
 							# this should really mount and check for recipe not seek(22)
 					f.seek(0)
-					magic = str(f,read(4)).strip()
+					magic = str(f.read(4)).strip()
  					if ord(magic[0])==69 and ord(magic[1])==61 and ord(magic[2])==205 
and ord(magic[3])==40:
 						# cramfs
 						f.close()
@@ -278,7 +278,7 @@

 			if not theme_icon:
 				# If icon doesn't belong to a theme, search it in the CMG
-				icon_files = self.find_files( self.path, "/usr/share/icons/", 
icon, omit_extension=True )
+				icon_files = self.find_files( "/usr/share/icons/", icon, 
omit_extension=True )
 				if icon_files:
 					return icon_files
 				else:

Modified: trunk/client/trunk/klikclient/lib/klik/integration.py
==============================================================================
--- trunk/client/trunk/klikclient/lib/klik/integration.py	(original)
+++ trunk/client/trunk/klikclient/lib/klik/integration.py	Tue Feb 26 
12:27:20 2008
@@ -26,6 +26,7 @@
 import shutil
 import re
 from klik.utils.freedesktop import DesktopParser
+from klik.cmg import KlikCmg
 from gettext import ngettext

 from klik.utils.xdg import XdgUtils
@@ -190,7 +191,8 @@
 			temp_icon_path = os.path.join( build_path, package_id + extension)
 			
 			# Try to extract icon from CMG
-			if self.base.extract_file( cmg_path, icon_path, temp_icon_path ):
+			cmg = KlikCmg(self.base, cmg_path)
+			if cmg.extract_file( icon_path, temp_icon_path ):
 				if not extension:
 					# Guess image type
 					import imghdr # TODO: svg? ---> add entry to 'tests' list
@@ -251,13 +253,14 @@
 			
 			# Registering one menu entry per desktop object found/created

-			desktop_objects = self.base.get_desktop_objects( cmg_path )
+			cmg = KlikCmg(self.base, cmg_path)
+			desktop_objects = cmg.get_desktop_objects(  )
 			for do in desktop_objects:
 				# Package ID is the CMG name escaped with the specific .desktop name...
 				package_id = self.__get_package_id( cmg_path, do )

  				# Icons: each menu entry can have many icons, in different sizes 
and themes
-				icon_list = self.base.scan_cmg_icons( cmg_path, do )
+				icon_list = cmg.scan_cmg_icons( do )
 				icon_list = filter( register_icon, icon_list )
 				if icon_list:
 					# At least one valid icon could be installed
_______________________________________________
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