示例#1
0
文件: monkey.py 项目: a25kk/stv2
def installPlonePAS(portal, out):
    """We have to install PlonePAS by calling the function directly
    instead of through QuickInstaller because our patches won't take
    if the function is called as an ExternalMethod."""
    NO_PLONEPAS = os.environ.get('SUPPRESS_PLONEPAS_INSTALLATION',
                                 None)=='YES'
    if NO_PLONEPAS:
        return

    origGrabUserData = InstallPlonePAS.grabUserData
    origReplaceUserFolder = InstallPlonePAS.replaceUserFolder
    origMigrateMemberDataTool = InstallPlonePAS.migrateMemberDataTool
    origRestoreUserData = InstallPlonePAS.restoreUserData

    # we assume the remember migration is desired if CMFMember is
    # installed
    qi = getToolByName(portal, 'portal_quickinstaller')
    HAS_CMFMEMBER = qi.isProductInstalled('CMFMember')
    if HAS_CMFMEMBER:
        InstallPlonePAS.grabUserData = grabUserData
        InstallPlonePAS.replaceUserFolder = replaceUserFolder
        InstallPlonePAS.migrateMemberDataTool = migrateMemberDataTool
        InstallPlonePAS.restoreUserData = restoreUserData

    installOrReinstallProduct(portal, 'PasswordResetTool', out)

    if HAS_CMFMEMBER:
        # run the installer directly and undo the patches
        result = InstallPlonePAS.install(portal)
        out.extend(result.split('\n'))

        InstallPlonePAS.grabUserData = origGrabUserData
        InstallPlonePAS.replaceUserFolder = origReplaceUserFolder
        InstallPlonePAS.migrateMemberDataTool = origMigrateMemberDataTool
        InstallPlonePAS.restoreUserData = origRestoreUserData
    else:
        installOrReinstallProduct(portal, 'PlonePAS', out)
示例#2
0
def installPlonePAS(portal, out):
    """We have to install PlonePAS by calling the function directly
    instead of through QuickInstaller because our patches won't take
    if the function is called as an ExternalMethod."""
    NO_PLONEPAS = os.environ.get('SUPPRESS_PLONEPAS_INSTALLATION',
                                 None) == 'YES'
    if NO_PLONEPAS:
        return

    origGrabUserData = InstallPlonePAS.grabUserData
    origReplaceUserFolder = InstallPlonePAS.replaceUserFolder
    origMigrateMemberDataTool = InstallPlonePAS.migrateMemberDataTool
    origRestoreUserData = InstallPlonePAS.restoreUserData

    # we assume the remember migration is desired if CMFMember is
    # installed
    qi = getToolByName(portal, 'portal_quickinstaller')
    HAS_CMFMEMBER = qi.isProductInstalled('CMFMember')
    if HAS_CMFMEMBER:
        InstallPlonePAS.grabUserData = grabUserData
        InstallPlonePAS.replaceUserFolder = replaceUserFolder
        InstallPlonePAS.migrateMemberDataTool = migrateMemberDataTool
        InstallPlonePAS.restoreUserData = restoreUserData

    installOrReinstallProduct(portal, 'PasswordResetTool', out)

    if HAS_CMFMEMBER:
        # run the installer directly and undo the patches
        result = InstallPlonePAS.install(portal)
        out.extend(result.split('\n'))

        InstallPlonePAS.grabUserData = origGrabUserData
        InstallPlonePAS.replaceUserFolder = origReplaceUserFolder
        InstallPlonePAS.migrateMemberDataTool = origMigrateMemberDataTool
        InstallPlonePAS.restoreUserData = origRestoreUserData
    else:
        installOrReinstallProduct(portal, 'PlonePAS', out)
示例#3
0
文件: alphas.py 项目: dtgit/dtedu
def installPlonePAS(portal, out):
    """Quickinstalls PlonePAS if not installed yet."""
    NO_PLONEPAS = os.environ.get('SUPPRESS_PLONEPAS_INSTALLATION',None)=='YES'
    if not NO_PLONEPAS:
        installOrReinstallProduct(portal, 'PasswordResetTool', out)
        installOrReinstallProduct(portal, 'PlonePAS', out)
示例#4
0
文件: alphas.py 项目: dtgit/dtedu
def installPlacefulWorkflow(portal, out):
    """Quickinstalls CMFPlacefulWorkflow if not installed yet."""
    # CMFPlacefulWorkflow is not installed by e.g. tests
    if 'CMFPlacefulWorkflow' in portal.Control_Panel.Products.objectIds():
        installOrReinstallProduct(portal, 'CMFPlacefulWorkflow', out)