git://git.onelab.eu
/
myslice.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'onelab' of ssh://git.onelab.eu/git/myslice into onelab
[myslice.git]
/
myslice
/
components.py
diff --git
a/myslice/components.py
b/myslice/components.py
index
44d6624
..
ea4d88c
100644
(file)
--- a/
myslice/components.py
+++ b/
myslice/components.py
@@
-1,16
+1,22
@@
from django.conf.urls import include, url
from django.conf.urls import include, url
-from myslice.configengine import ConfigEngine
+from myslice.settings import config, logger
+
+def list():
+ if config.myslice.components :
+ return config.myslice.components.split(',')
+ else :
+ return []
def urls():
def urls():
- config = ConfigEngine()
u = []
u = []
- for component in
config.myslice.components.split(','
):
+ for component in
list(
):
try:
__import__(component)
u.append( url(r'^%s/' % component, include('%s.urls' % component)) )
except Exception, e:
try:
__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:
else:
- print "-> Loaded component %s" % component
+ logger.info("Loaded component {}".format(component))
return u
return u
+