#!/usr/bin/env python # $Id: S02KusuDataFS.rc.py 137 2007-12-18 19:05:04Z mblack $ # # Copyright 2007 Platform Computing Corporation. # # Licensed under GPL version 2; See LICENSE for details. from path import path from kusu.core import rcplugin import subprocess import sys class KusuRC(rcplugin.Plugin): def __init__(self): rcplugin.Plugin.__init__(self) self.name = 'OCS Documentation sources' self.desc = 'Setting up Platform OCS Documentation sources' self.ngtypes = ['installer'] self.delete = True def run(self): """Setting up Kusu Documentation sources""" datafs = path('/opt/kusu/share/doc/ocs/Data.fs') olddatafs = path('/opt/Plone-3.0.3/zinstance/var/Data.fs') if not datafs.exists(): return False if not olddatafs.exists(): return False # delete the stock Data.fs olddatafs.remove() # copy our Data.fs into the old path datafs.copy('/opt/Plone-3.0.3/zinstance/var') # set permissions cmd = 'chown plone:plone Data.fs' permsP = subprocess.Popen(cmd,cwd='/opt/Plone-3.0.3/zinstance/var',shell=True) return True