From: Benoît Pin Date: Wed, 16 Jul 2014 09:36:00 +0000 (+0200) Subject: try / except pour démarrer sans Solr. X-Git-Url: https://scm.cri.mines-paristech.fr/git/Plinn.git/commitdiff_plain/fc06e9578d3d8b09689be7c58a92eec7b0175a57?hp=8a303e66fd249f6bb2f9ba0522eca355fe401ab6 try / except pour démarrer sans Solr. --- diff --git a/__init__.py b/__init__.py index d4f4f53..fe63530 100755 --- a/__init__.py +++ b/__init__.py @@ -38,7 +38,11 @@ import GroupDataTool import RegistrationTool import CalendarTool import AttachmentTool -import catalog +try : + import catalog + __solr_ok = True +except ImportError : + __solr_ok = False from PloneMisc import IndexIterator, Batch import patch @@ -57,8 +61,9 @@ tools = ( MembershipTool.MembershipTool , RegistrationTool.RegistrationTool , CalendarTool.CalendarTool , AttachmentTool.AttachmentTool - , catalog.CatalogTool ) +if __solr_ok : + tools += (catalog.CatalogTool,) # register files extensions registerFileExtension('ttf', FSFile)