#!/usr/bin/env python
from optparse import OptionParser
+import os
from os import path
from urllib import urlencode
'tools.encode.on': True,
'tools.encode.encoding': 'utf8',
})
+
+ static_dir = path.abspath(options.static_dir)
app_config = {
'/static': {
'tools.staticdir.on': True,
- 'tools.staticdir.dir': path.abspath(options.static_dir),
+ 'tools.staticdir.dir': static_dir,
}
}
- cherrypy.quickstart(w, '/', app_config)
+ raw_link = path.join(static_dir, 'raw')
+ os.symlink(path.relpath(d.raw_dir, static_dir), raw_link)
+ try:
+ cherrypy.quickstart(w, '/', app_config)
+ finally:
+ os.remove(raw_link)
element.file_path = path;
element.file_tags = tags;
element.tree_id = id;
- // element.source = ...
+ element.setAttribute('src', '/static/raw/'+path.join('/'));
}
function raw_tree_select() {