12 import pygraphviz as pgv
16 from amara import bindery
17 from amara.xslt import transform
18 from Cheetah.Template import Template
21 """Class containing the state of the directory with articles"""
27 for dirname, dirnames, filenames in os.walk(self._cwd):
28 for filename in filenames:
29 if fnmatch.fnmatch(filename, '*.xml'):
30 file_ = os.path.join(dirname,filename)
31 doc = bindery.parse(file_, prefixes=PREFIXES)
32 title = doc.xml_select(u'/db:article/db:info/db:title')
33 menu = doc.xml_select(u'/db:article/db:info/db:titleabbrev')
35 base = file_.split('.')[1]
36 link = base.replace('index','')
37 self._tree.append(link)
40 return set(self._tree)