capuchin r87 - in trunk: . examples



Author: sebp
Date: Thu Apr  3 21:52:45 2008
New Revision: 87
URL: http://svn.gnome.org/viewvc/capuchin?rev=87&view=rev

Log:
Adjusted examples to API change

Modified:
   trunk/ChangeLog
   trunk/examples/testapp.cs
   trunk/examples/testapp.py

Modified: trunk/examples/testapp.cs
==============================================================================
--- trunk/examples/testapp.cs	(original)
+++ trunk/examples/testapp.cs	Thu Apr  3 21:52:45 2008
@@ -29,7 +29,6 @@
 		this.appobject = bus.GetObject<Capuchin.IAppObject> (CAPUCHIN_SERVICE, path);
 		this.appobject.InstallFinished += new Capuchin.InstallFinishedHandler ( this.OnInstallFinished );
 		this.appobject.Status += new Capuchin.StatusHandler ( this.OnStatus );
-		this.appobject.UpdateFinished += new Capuchin.UpdateFinishedHandler ( delegate () { ContinueMain(); } );
 	}
 	
 	protected void OnInstallFinished(string plugin_id)
@@ -41,7 +40,7 @@
 	{
 		Console.WriteLine ("DOWNLOAD: {0} {1} {2} {3}", action, plugin_id, progress, speed);
 	}
-	
+        
 	public void testUpdate()
 	{
 		this.appobject.Update(false);
@@ -118,9 +117,11 @@
 		this.appobject.Close();
 	}
 	
-	public static void ContinueMain()
+	public static void Main (string[] args)
 	{
-        test.testGetApplicationName();
+		test.testGetAppObject();
+        test.testUpdate();
+		test.testGetApplicationName();
         test.testGetAvailablePlugins();
 		test.testGetAvailableUpdates();
 		test.testGetTags ();
@@ -129,11 +130,4 @@
 		Thread.Sleep(10000); // Wait 5s for update to complete, because we have no mainloop
 		test.testClose();
 	}
-	
-	public static void Main (string[] args)
-	{
-		test.testGetAppObject();
-        test.testUpdate();
-		Thread.Sleep(5000); // Wait 5s for update to complete, because we have no mainloop
-	}
 }

Modified: trunk/examples/testapp.py
==============================================================================
--- trunk/examples/testapp.py	(original)
+++ trunk/examples/testapp.py	Thu Apr  3 21:52:45 2008
@@ -32,7 +32,6 @@
         
         self.appobject.connect_to_signal('InstallFinished', self.on_install_finished)
         self.appobject.connect_to_signal('Status', self.on_status)
-        self.appobject.connect_to_signal('UpdateFinished', self.on_update_finished)
         
     def on_install_finished(self, plugin_id):
         print "appobject updated: %s" % plugin_id
@@ -52,8 +51,11 @@
     def on_status(self, action, plugin_id, progress, speed):
         print "DOWNLOAD: %s %s %s %s" % (action, plugin_id, progress, speed)
         
+    def on_error(self, error):
+        print "ERROR: " +error
+        
     def testUpdate(self):
-        self.appobject.Update(False)
+        self.appobject.Update(False, reply_handler=self.on_update_finished, error_handler=self.on_error)
         
     def testGetAvailablePlugins(self):
         stuff = self.appobject.GetAvailablePlugins();



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]