% (' '*(4*len(node)-2), self._dir_html_link(node, data)))
def _dir_html_link(self, node, data):
+ root = 'raw'
+ if node.root == self.dirtag.tag_dir:
+ root = 'tag'
return ('<a href="%s">%s</a>'
% ('dir?%s' % urlencode({
- 'root':node.root,
+ 'root':root,
'selected':'/'.join(node),
}),
'/'.join(node)))
style = 'style="height=200px; width=200px;"'
type,encoding = guess_type(node[-1])
return ('<iframe %s src="static/raw/%s"></iframe>'
- % (style, '/'.join(node)))
+ % (style, '/'.join(self.dirtag.raw_node(node))))
#elif node[-1].endswith('.jpg'):
# return ('<img %s " src="static/raw/%.s"/>'
# % (style, '/'.join(node)))
)
def _selected_dir(self, root, selected):
- if root == self.dirtag.raw_dir:
+ if root == 'raw':
tree = dir_tree(self.dirtag.raw_dir)
else:
- assert root == self.dirtag.tag_dir, root
+ assert root == 'tag', root
tree = dir_tree(self.dirtag.tag_dir)
s = None
for node in tree.traverse(depth=1, type='dirs'):