Author: dmeyer
Date: Sun Apr 15 10:32:27 2007
New Revision: 9455

Modified:
   trunk/core/src/resources.py

Log:
suspended is not class variable

Modified: trunk/core/src/resources.py
==============================================================================
--- trunk/core/src/resources.py (original)
+++ trunk/core/src/resources.py Sun Apr 15 10:32:27 2007
@@ -38,7 +38,6 @@
     The ResourceHandler inherit from it if you want to use resources that need
     a specific access rights.
     """
-    __suspended = []
     __resources = {}
 
     @yield_execution(lock=True)
@@ -52,6 +51,9 @@
         returns False on failure (not possible), True when all resources
         are reserved or InProgress if it is possible and takes a while.
         """
+        if not hasattr(self, '_ressources_suspended'):
+            self._ressources_suspended = []
+
         blocked = {}
         blocking = []
         for r in resources:
@@ -74,8 +76,8 @@
 
         # suspend modules (if any)
         for module in blocking:
-            if not module in self.__suspended:
-                self.__suspended.append(module)
+            if not module in self._ressources_suspended:
+                self._ressources_suspended.append(module)
             answer = module.suspend()
             if isinstance(answer, InProgress):
                 yield answer
@@ -88,7 +90,7 @@
         # FIXME: what happens if a resumed application will
         # try to get the ressources and can't do that? We
         # need a way for application/plugin x to connect to
-        # the __suspended list of y.
+        # the _ressources_suspended list of y.
 
         # reserve all resources
         for r in resources:
@@ -103,6 +105,8 @@
         Free all resources blocked by this instance. If resume is True, this
         function will also resume all modules this object has suspended.
         """
+        if not hasattr(self, '_ressources_suspended'):
+            self._ressources_suspended = []
         for res, app in ResourceHandler.__resources.items()[:]:
             if app == self:
                 del ResourceHandler.__resources[res]
@@ -110,10 +114,10 @@
             # done here
             return True
         # resume suspended modules
-        for handler in self.__suspended:
+        for handler in self._ressources_suspended:
             handler.resume()
         # clear list with suspended since all resumed
-        self.__suspended = []
+        self._ressources_suspended = []
 
 
     def can_suspend(self):

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to