+ def status(self):
+ status = self._doc.xpath(u'/db:article[@status]',namespaces=const.XPATH)
+ if status:
+ return unicode(status[0].get('status'))
+ return None
+
+ def role(self):
+ art = self._doc.xpath(u'/db:article[@role]',namespaces=const.XPATH)
+ if art:
+ return unicode(art[0].get('role'))
+ return 'index'
+
+ def userlevel(self):
+ lvl = self._doc.xpath(u'/db:article[@userlevel]',namespaces=const.XPATH)
+ if lvl:
+ lvlstr = unicode(lvl[0].get('userlevel'))
+ return {
+ 'Level 1': 1,
+ 'Level 2': 2,
+ 'Level 3': 3,
+ 'Level 4': 4,
+ 'Level 5': 5,
+ }.get(lvlstr, 0)
+ return 0
+