Move root directory into data/web

* rename root -> data/web:
 * setup.py:
   change install source path
 * wcs/root.ptl:
   add StaticDirectory controller to find static files.
This commit is contained in:
Benjamin Dauvergne 2009-04-22 15:18:35 +00:00
parent 005744b0f4
commit 874972d00c
8 changed files with 3 additions and 1 deletions

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 133 B

After

Width:  |  Height:  |  Size: 133 B

View File

Before

Width:  |  Height:  |  Size: 440 B

After

Width:  |  Height:  |  Size: 440 B

View File

Before

Width:  |  Height:  |  Size: 469 B

After

Width:  |  Height:  |  Size: 469 B

View File

@ -33,7 +33,7 @@ setup(
'wcs.qommon.vendor'],
cmdclass = {'build_py': qx_build_py},
scripts = ['wcsctl.py'],
data_files = data_tree('share/wcs/web/', 'root/') + \
data_files = data_tree('share/wcs/web/', 'data/web/') + \
data_tree('share/wcs/themes/', 'data/themes/') + \
data_tree('share/wcs/qommon/', 'wcs/qommon/static/')
)

View File

@ -216,6 +216,8 @@ class RootDirectory(Directory):
return forms.root.RootDirectory()._q_traverse(path)
def _q_lookup(self, component):
if component in ('css','images'):
return StaticDirectory(os.path.join(get_publisher().data_dir, 'web', component), follow_symlinks = True)
if component == 'qo':
dirname = os.path.join(get_publisher().data_dir, 'qommon')
return StaticDirectory(dirname, follow_symlinks = True)