4 from amara import bindery
5 import treecutter.const as const
8 """Class containing the state of the directory with articles"""
14 for dirname, dirnames, filenames in os.walk(self._cwd):
15 for filename in filenames:
16 if fnmatch.fnmatch(filename, '*.xml'):
17 file_ = os.path.join(dirname,filename)
18 doc = bindery.parse(file_, prefixes=const.PREFIXES)
19 title = doc.xml_select(u'/db:article/db:info/db:title')
20 menu = doc.xml_select(u'/db:article/db:info/db:titleabbrev')
22 base = file_.split('.')[1]
23 link = base.replace('index','')
24 self._tree.append(link)
27 return set(self._tree)