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

List:       klik-devel
Subject:    [klik-devel] [klikclient commit] r1236 -
From:       codesite-noreply () google ! com
Date:       2008-02-25 23:27:08
Message-ID: 001636e0a64a044703e91ae56f1654f () google ! com
[Download RAW message or body]

Author: KillerKiwi2005
Date: Mon Feb 25 15:26:13 2008
New Revision: 1236

Modified:
   trunk/client/trunk/klikclient/lib/klik/cmg.py
   trunk/client/trunk/klikclient/lib/klik/execute.py
   trunk/client/trunk/klikclient/lib/klik/settings.py

Log:
Cleaned up some spelling and comments

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	Mon Feb 25 15:26:13 2008
@@ -1,3 +1,24 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+#   klik2
+#   Copyright (C) 2008  Jason Taylor - killerkiwi2005@gmail.com
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 
02111-1307, USA.
+
+
 import os
 import platform
 import subprocess
@@ -14,27 +35,23 @@
 class KlikCmg(object):


-
 	def __init__(self, klik, path):

-		# private varibles
+		# private variables
 		self.__directories = None
 		self.__recipe = None
 		self.__sandbox = None
 		self.__cmg_version = -1

-		# Public varibles
+		# Public variables
 		self.desktop_files = []
 		self.desktop_files_fixed = []
 		self.icon = None
 		self.path = path
+		self.sandbox = KlikSandBox(path)
+		self.mount_point_path = None
 		
 		self.klik = klik
-		self.mount_point_path = None
-		self.command = None
-		self.args = []
-
-		self.sandbox = KlikSandBox(path)

 	def exists(self):
 		return os.path.exists(self.path)
@@ -195,7 +212,6 @@
 			self.__cmg_version = 0
 		return self.__cmg_version

-	# MOVE TO cmg.py
 	def __is_klik2_cmg(self):
 		# Klik2 Compatability....
 		f = open(self.path, "r")
@@ -206,7 +222,6 @@
 		f.close()
 		return test
 	
-	# MOVE TO cmg.py
 	def __is_klik1_cmg(self):
 		# Klik1 Compatability....
 		f = open(self.path, "r")
@@ -215,7 +230,6 @@
 		f.close()
 		return test
 		
-	# MOVE TO cmg.py
 	# Return all the files in a given CMG that match pre and post text
 	def find_files(self, pre_text=None, post_text=None, omit_extension=False):
 		if omit_extension:
@@ -239,8 +253,7 @@
 		p.stdout.close()

 		return files
-		
-	# MOVE TO cmg.py
+
 	def scan_cmg_icons(self, do):
 		# Returns a list of icons for a .desktop entry

@@ -274,7 +287,6 @@
 					return ["/.DirIcon"]


-	# MOVE TO cmg.py
 	# Get desktop objects set to execute cmg
 	def get_desktop_objects(self, fix_exec=True):

@@ -382,7 +394,6 @@
 		
 		return desktop_objects

-	# MOVE TO cmg.py
 	def extract_icon(self, file_path_to, image_size=24):
 		if self.extract_file("/.DirIcon", file_path_to):


Modified: trunk/client/trunk/klikclient/lib/klik/execute.py
==============================================================================
--- trunk/client/trunk/klikclient/lib/klik/execute.py	(original)
+++ trunk/client/trunk/klikclient/lib/klik/execute.py	Mon Feb 25 
15:26:13 2008
@@ -138,11 +138,11 @@

 		# HACKS END HERE - we need to remove these if at all possible !!!

-		return command, cmg.mount_point_path
+		return command

 	def execute_shell(self, cmg, command):
 	
-		command, mount_point_path = self.__prep (cmg, [command], None)
+		command = self.__prep (cmg, [command], None)

  		args =  ["chroot", mount_point_path, "bash", "--rcfile", 
os.path.abspath(os.path.join(sys.path[0], os.path.pardir, "share", "klik", "bashrc")), "-i"]
 		print """=====================================================
@@ -153,11 +153,11 @@
 Type "exit" to return
 ====================================================="""
 		try:
-			p = Popen(args, env=os.environ.copy(), cwd=mount_point_path)
+			p = Popen(args, env=os.environ.copy(), cwd=cmg.mount_point_path)
 			p.wait()

 		except Exception, text:
-			self.umnount_cmg (mount_point_path)
+			self.umnount_cmg (cmg.mount_point_path)
 			raise ExecuteException("Error occurred while starting application")

 		self.umnount_cmg (mount_point_path)
@@ -167,14 +167,14 @@
 	# Execute should always be the same, regardless of mount type (hopefully)
 	def execute(self, cmg, command, execute_args, catch_errors=False):

-		command, mount_point_path = self.__prep(cmg, [command], execute_args)
+		command = self.__prep(cmg, [command], execute_args)

 		p = None
 		error_log_path = None
 		error_log = None
 		error_text = ""
 		application_returncode = 0
-		args = ["chroot", mount_point_path] + command
+		args = ["chroot", cmg.mount_point_path] + command
 		try:
 			if catch_errors:
 				
@@ -183,7 +183,7 @@
 				error_log = open(error_log_path, "w")
 				self.klik.temp_paths.append( error_log_path )

-				p = Popen(args, close_fds=True, env=os.environ, 
cwd=mount_point_path, stderr=PIPE)
+				p = Popen(args, close_fds=True, env=os.environ, 
cwd=cmg.mount_point_path, stderr=PIPE)
 				for line in p.stderr:
 					sys.stderr.write(line)
 					error_log.write(line)
@@ -194,10 +194,10 @@

 		except Exception, text:
 			
-			self.umnount_cmg (mount_point_path)
+			self.umnount_cmg (cmg.mount_point_path)
  			raise ExecuteException("Error occurred while starting application 
- " + str(text))

-		self.umnount_cmg (mount_point_path)
+		self.umnount_cmg (cmg.mount_point_path)
 		
 		# Tidy up the error log tee
 		if catch_errors:
@@ -224,12 +224,12 @@
 	# Execute should always be the same, regardless of mount type (hopefully)
 	def check_for_missing_library(self, cmg, command):

-		command, mount_point_path = self.__prep(cmg, [command], [None], False)
+		command = self.__prep(cmg, [command], [None], False)

 		p = None
 		text = ""
 		application_returncode = 0
-		args = ["chroot", mount_point_path, "which"] + command
+		args = ["chroot", cmg.mount_point_path, "which"] + command
 		try:
 			#os.environ["LD_TRACE_LOADED_OBJECTS"] = "1"
  			command = Popen(args, env=os.environ, cwd=mount_point_path , 
stdout=PIPE, stderr=open(os.devnull, "w")).communicate()[0].strip()
@@ -240,10 +240,10 @@
 			#os.environ["LD_TRACE_LOADED_OBJECTS"] = ""
 		except Exception, text:
 			#os.environ["LD_TRACE_LOADED_OBJECTS"] = ""
-			self.umnount_cmg (mount_point_path)
+			self.umnount_cmg (cmg.mount_point_path)
 			raise ExecuteException("Error occurred while starting application")

 		
-		self.umnount_cmg (mount_point_path)
+		self.umnount_cmg (cmg.mount_point_path)

 		return text

Modified: trunk/client/trunk/klikclient/lib/klik/settings.py
==============================================================================
--- trunk/client/trunk/klikclient/lib/klik/settings.py	(original)
+++ trunk/client/trunk/klikclient/lib/klik/settings.py	Mon Feb 25 
15:26:13 2008
@@ -32,7 +32,6 @@
 	default_feedback_url = "http://klik.atekon.de/feedback/"
 	version = "1.9.2"
 	config_path = "~/.klik"
-	

 	authors = ["Simon Peter <probono@myrealbox.com>",
 			"Kurt Pfeifle <pfeifle@kde.org>",
_______________________________________________
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