~vcs-imports/silva/trunk

« back to all changes in this revision

Viewing changes to Root.py

  • Committer: sylvain
  • Date: 2010-09-03 08:50:31 UTC
  • Revision ID: vcs-imports@canonical.com-20100903085031-vetrybm5r8rzsb6w
Protect ourselves against confusion.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# Copyright (c) 2002-2010 Infrae. All rights reserved.
2
2
# See also LICENSE.txt
3
 
# $Id: Root.py 44968 2010-09-03 08:47:43Z sylvain $
 
3
# $Id: Root.py 44969 2010-09-03 08:50:31Z sylvain $
4
4
 
5
5
# Zope 3
6
6
from zope import schema, interface, component
282
282
    # this root is the new local site
283
283
    setSite(root)
284
284
    setHooks()
285
 
    # now set it all up
286
 
    install.installFromScratch(root)
287
 
    root.set_title(title)
288
 
 
289
 
    if add_search:
290
 
        # install a silva find instance
291
 
        factory = root .manage_addProduct['SilvaFind']
292
 
        factory.manage_addSilvaFind('search', 'Search this site')
293
 
 
294
 
    if add_docs:
295
 
        # install the user documentation .zexp
296
 
        install_documentation(root)
297
 
 
298
 
    if REQUEST is not None:
299
 
        add_and_edit(self, id, REQUEST)
 
285
    try:
 
286
        # now set it all up
 
287
        install.installFromScratch(root)
 
288
        root.set_title(title)
 
289
 
 
290
        if add_search:
 
291
            # install a silva find instance
 
292
            factory = root .manage_addProduct['SilvaFind']
 
293
            factory.manage_addSilvaFind('search', 'Search this site')
 
294
 
 
295
        if add_docs:
 
296
            # install the user documentation .zexp
 
297
            install_documentation(root)
 
298
 
 
299
        if REQUEST is not None:
 
300
            add_and_edit(self, id, REQUEST)
 
301
    except:
 
302
        # If there is an error, reset the local site. This prevent
 
303
        # more confusion.
 
304
        setSite(None)
 
305
        setHooks()
 
306
        raise
300
307
    return ''