Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 22 Jul 2007 03:22:32 GMT
From:      Andrew Turner <andrew@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 123876 for review
Message-ID:  <200707220322.l6M3MWjC099260@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help

http://perforce.freebsd.org/chv.cgi?CH=123876

Change 123876 by andrew@andrew_hermies on 2007/07/22 03:22:29

	Support list_installed in the front end
	Remove the Downloaded item from the tree view as it is unused

Affected files ...

.. //depot/projects/soc2007/andrew-update/frontend/facund/computer.py#5 edit

Differences ...

==== //depot/projects/soc2007/andrew-update/frontend/facund/computer.py#5 (text+ko) ====

@@ -51,7 +51,7 @@
 		self.__dirs = []
 		self.__connected = False
 		self.__connection = None
-		self.__commands = ['Avaliable', 'Downloaded', 'Installed']
+		self.__commands = ['Avaliable', 'Installed']
 
 	def __str__(self):
 		return self.__name + ": " + self.__host
@@ -83,6 +83,8 @@
 		print self.__commands[command]
 		if self.__commands[command] == 'Avaliable':
 			return self.getUpdateList(dir)
+		elif self.__commands[command] == 'Installed':
+			return self.getInstalledList(dir)
 		else:
 			print 'TODO: Handle this command (%d)' % (command,);
 
@@ -102,6 +104,22 @@
 		call.releaseLock()
 		return call.getResponse()
 
+	def getInstalledList(self, dir = None):
+		if dir is None:
+			for dir in self.__dirs:
+				args = None
+		else:
+			args = facund.Array()
+			args.append(facund.String("base"))
+			args.append(facund.String(dir))
+
+		call = facund.Call("list_installed", args)
+		self.__connection.doCall(call)
+		# Wait for the response
+		call.acquireLock()
+		call.releaseLock()
+		return call.getResponse()
+
 	def connect(self):
 		'''Connects to the remote computer'''
 		if self.__connection is not None:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200707220322.l6M3MWjC099260>