cwconfig.py
changeset 4135 cb0d0bf255f7
parent 4023 eae23c40627a
child 4181 c79135c217df
--- a/cwconfig.py	Thu Dec 10 18:00:15 2009 +0100
+++ b/cwconfig.py	Fri Dec 18 14:07:16 2009 +0100
@@ -78,10 +78,11 @@
 import sys
 import os
 import logging
+import tempfile
 from smtplib import SMTP
 from threading import Lock
 from os.path import exists, join, expanduser, abspath, normpath, basename, isdir
-import tempfile
+from warnings import warn
 
 from logilab.common.decorators import cached
 from logilab.common.deprecation import deprecated
@@ -480,14 +481,23 @@
                                 (ctlfile, err))
                 cls.info('loaded cubicweb-ctl plugin %s', ctlfile)
         for cube in cls.available_cubes():
-            pluginfile = join(cls.cube_dir(cube), 'ecplugin.py')
+            oldpluginfile = join(cls.cube_dir(cube), 'ecplugin.py')
+            pluginfile = join(cls.cube_dir(cube), 'ccplugin.py')
             initfile = join(cls.cube_dir(cube), '__init__.py')
             if exists(pluginfile):
                 try:
+                    __import__('cubes.%s.ccplugin' % cube)
+                    cls.info('loaded cubicweb-ctl plugin from %s', cube)
+                except:
+                    cls.exception('while loading plugin %s', pluginfile)
+            elif exists(oldpluginfile):
+                warn('[3.6] %s: ecplugin module should be renamed to ccplugin' % cube,
+                     DeprecationWarning)
+                try:
                     __import__('cubes.%s.ecplugin' % cube)
                     cls.info('loaded cubicweb-ctl plugin from %s', cube)
                 except:
-                    cls.exception('while loading plugin %s', pluginfile)
+                    cls.exception('while loading plugin %s', oldpluginfile)
             elif exists(initfile):
                 try:
                     __import__('cubes.%s' % cube)