# $Id: 0-7-x_1-0-0.py,v 1.3 2001/03/22 19:22:09 fresh Exp $

from Products.Squishdot.Updaters.updatesupport import updateall,_log
from Products.Squishdot.Updaters import fix_threading
from Products.Squishdot.Updaters import fix_replies
import sys

def do_update(self):
    """ Do the update """
    # add valid_tags property
    try:
        self.manage_addProperty('valid_tags',['b\na\ni\nbr\np'],'lines')
        thestring = _log('','Added valid_tags property.')
    except:
        thestring = _log('','Could not add valid_tags property:\nType: %s\nValue: %s'%(sys.exc_type,sys.exc_value))

    # code to redo threads
    thestring = thestring + fix_threading.do_update(self)
    
    # code to fix reply counts
    thestring = thestring + fix_replies.do_update(self)
    
    # code to re-index everything
    self.recatalogPostings()
    thestring = _log(thestring,'Re-catalogued everything to be safe.')

    return thestring


def update(self):
    return updateall(self,do_update)




