|
a/Allura/allura/config/resources.py |
|
b/Allura/allura/config/resources.py |
1 |
import os
|
1 |
import os
|
|
|
2 |
import logging
|
2 |
|
3 |
|
3 |
import pkg_resources
|
4 |
import pkg_resources
|
|
|
5 |
|
|
|
6 |
log = logging.getLogger(__name__)
|
4 |
|
7 |
|
5 |
def register_ew_resources(manager):
|
8 |
def register_ew_resources(manager):
|
6 |
manager.register_directory(
|
9 |
manager.register_directory(
|
7 |
'js', pkg_resources.resource_filename('allura', 'lib/widgets/resources/js'))
|
10 |
'js', pkg_resources.resource_filename('allura', 'lib/widgets/resources/js'))
|
8 |
manager.register_directory(
|
11 |
manager.register_directory(
|
9 |
'css', pkg_resources.resource_filename('allura', 'lib/widgets/resources/css'))
|
12 |
'css', pkg_resources.resource_filename('allura', 'lib/widgets/resources/css'))
|
10 |
manager.register_directory(
|
13 |
manager.register_directory(
|
11 |
'allura', pkg_resources.resource_filename('allura', 'public/nf'))
|
14 |
'allura', pkg_resources.resource_filename('allura', 'public/nf'))
|
12 |
for ep in pkg_resources.iter_entry_points('allura'):
|
15 |
for ep in pkg_resources.iter_entry_points('allura'):
|
|
|
16 |
try:
|
13 |
manager.register_directory(
|
17 |
manager.register_directory(
|
14 |
'tool/%s' % ep.name,
|
18 |
'tool/%s' % ep.name,
|
15 |
pkg_resources.resource_filename(
|
19 |
pkg_resources.resource_filename(
|
16 |
ep.module_name,
|
20 |
ep.module_name,
|
17 |
os.path.join('nf', ep.name)))
|
21 |
os.path.join('nf', ep.name)))
|
|
|
22 |
except ImportError:
|
|
|
23 |
log.warning('Cannot import entry point %s', ep)
|
|
|
24 |
continue
|