File: fix_threading.py

package info (click to toggle)
squishdot 1.3.0-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 896 kB
  • ctags: 349
  • sloc: python: 2,313; makefile: 56; sh: 54
file content (28 lines) | stat: -rw-r--r-- 774 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# $Id: fix_threading.py,v 1.2 2001/05/07 20:42:53 fresh Exp $
from Products.UpdateSupport.updatesupport import _updateall,_log

def _recursor(self,dict,obj):
        for id in obj.ids:
            dict[id]={}
            _recursor(self,dict[id],self.data[id])

def _updatethread(self,dict,list):
    for id in dict.keys():
        theList = []
        for x in list:
            theList.append(x)
        
        self.data[id].thread = theList
                
        _updatethread(self,dict[id],list + [id])

def do_update(self):
    """ Do the update """
    root = {}
    _recursor(self,root,self)
    _updatethread(self,root,[])
    return _log('',"Threading fixed.")

def update(self):
    return _updateall(self,do_update, metatypes=['Squishdot Site'])