X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=myslice%2Fcomponents.py;h=ea4d88c5a8fbb02570ee5abf95b61549b69ce279;hb=829c3ba3d1bcf6e1aae4e21a8f60ec72fc815340;hp=cfabb6343532fe1be175f55a446f60f3c0933a9a;hpb=3767be0431acff930350879b9562688f31484163;p=myslice.git diff --git a/myslice/components.py b/myslice/components.py index cfabb634..ea4d88c5 100644 --- a/myslice/components.py +++ b/myslice/components.py @@ -1,9 +1,11 @@ from django.conf.urls import include, url -from myslice.configengine import ConfigEngine +from myslice.settings import config, logger def list(): - config = ConfigEngine() - return config.myslice.components.split(',') + if config.myslice.components : + return config.myslice.components.split(',') + else : + return [] def urls(): u = [] @@ -12,9 +14,9 @@ def urls(): __import__(component) u.append( url(r'^%s/' % component, include('%s.urls' % component)) ) except Exception, e: - print "-> Cannot load component (%s): %s" % (component, e) + logger.error("Cannot load component ({}): {}".format(component, e)) else: - print "-> Loaded component %s" % component + logger.info("Loaded component {}".format(component)) return u