root/CPS3/products/CPSLuceneCatalog/trunk/__init__.py

Revision 45611, 1.8 kB (checked in by tziade, 4 years ago)

fixed ImportError? since CPSInstaller is not in use anymore

  • Property svn:keywords set to Id
Line 
1 # (C) Copyright 2006 Nuxeo SAS <http://nuxeo.com>
2 # Author: Julien Anguenot <ja@nuxeo.com>
3 #
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License version 2 as published
6 # by the Free Software Foundation.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
16 # 02111-1307, USA.
17 #
18 # $Id$
19 """CPS Lucene Catalog
20 """
21
22 try:
23     import BBB.PatchCPSInstallerCMFInstaller
24 except ImportError:
25     # we don't need to apply the patch if CPSInstaller doesn't exists
26     pass
27
28 from Products.GenericSetup import profile_registry
29 from Products.GenericSetup import EXTENSION
30
31 from Products.CMFCore.utils import ToolInit
32 from Products.CMFCore.DirectoryView import registerDirectory
33
34 from Products.CPSCore.interfaces import ICPSSite
35
36 import brain
37
38 registerDirectory('skins', globals())
39
40 def initialize(registrar):
41
42     import catalog
43
44     ToolInit(
45         meta_type="CPS Lucene Catalog Tool",
46         tools=(catalog.CPSLuceneCatalogTool,),
47         icon="tool.png",
48         ).initialize(registrar)
49
50     try:
51         profile_registry.registerProfile(
52             'default',
53             'CPS Lucene Catalog',
54             "Lucene based catalog for CPS",
55             'profiles/default',
56             'CPSLuceneCatalog',
57             EXTENSION,
58             for_=ICPSSite)
59     except KeyError:
60         # Allow the use of refresh
61         # Already registred
62         pass
Note: See TracBrowser for help on using the browser.