[Extras-cauldron-commits] r127 - branches/qserver_branch/devel-mover

danielwilms at garage.maemo.org danielwilms at garage.maemo.org
Wed Apr 1 19:03:38 EEST 2009


Author: danielwilms
Date: 2009-04-01 19:03:37 +0300 (Wed, 01 Apr 2009)
New Revision: 127

Modified:
   branches/qserver_branch/devel-mover/interface.py
Log:
copy-method changed that it uses qserver now

Modified: branches/qserver_branch/devel-mover/interface.py
===================================================================
--- branches/qserver_branch/devel-mover/interface.py	2009-04-01 15:47:01 UTC (rev 126)
+++ branches/qserver_branch/devel-mover/interface.py	2009-04-01 16:03:37 UTC (rev 127)
@@ -27,7 +27,7 @@
 
 __revision__ = '$Revision$'[11:-2]
 
-import sys, os, cgi, logging
+import sys, os, cgi, logging, dbus, time
 from shutil import copyfile
 from commands import getstatusoutput
 from types import ListType
@@ -121,8 +121,26 @@
 
     def copy(self, source, dest):
         self.__logger.debug('copy: %s -> %s' % (source, dest))
-        copyfile(source, dest)
-
+	try:
+            bus = dbus.SystemBus ()
+            FileCopyHandler = dbus.Interface ( bus.get_object ('org.maemo.test_server','/'),
+                                          'org.maemo.filecopy_interface')
+            id = FileCopyHandler.filecopy ('%s/%s.txt'%(path_src,f),'%s/%s.txt'%(path_dest,f))
+            status,msg = FileCopyHandler.get_status_information(id)
+            a=0
+            while a<10:
+                if status == 1:
+                    return False
+                elif status == 3:
+                    return True
+                else:
+                    time.sleep (0.1)
+                    a += 1
+                    status,msg = FileCopyHandler.get_status_information(id)
+            return False
+            
+        except dbus.DBusException:
+            copyfile(source, dest)
         # Actually, we need to make sure that the file was copied
         return True
 



More information about the Extras-cauldron-commits mailing list