SLA plugin: fixed template shown in dialog
[myslice.git] / myslice / components.py
1 from django.conf.urls import include, url
2 from myslice.settings import config, logger
3
4 def list():
5     if config.myslice.components :
6         return config.myslice.components.split(',')
7     else :
8         return []
9
10 def urls():
11     u = []
12     for component in list():
13         try:
14             __import__(component)
15             u.append( url(r'^%s/' % component, include('%s.urls' % component)) )
16         except Exception, e:
17             logger.error("Cannot load component ({}): {}".format(component, e))
18         else:
19             logger.info("Loaded component {}".format(component))
20             
21     return u
22