Exemple #1
0
 def next(self):
     info = List.next(self, full=True)
     if info['ns'] == 14:
         return Category(self.site, u'', info)
     if info['ns'] == 6:
         return page.Image(self.site, u'', info)
     return page.Page(self.site, u'', info)
Exemple #2
0
	def get(self, name, info = ()):
		if self.namespace == 14:
			return Category(self.site, self.site.namespaces[14] + ':' + name, info)
		elif self.namespace == 6:
			return page.Image(self.site, self.site.namespaces[6] + ':' + name, info)
		elif self.namespace != 0:
			return page.Page(self.site, self.site.namespaces[self.namespace] + ':' + name, info)
		else:
			# Guessing page class
			namespace = self.guess_namespace(name)
			if namespace == 14:
				return Category(self.site, name, info)
			elif namespace == 6:
				return page.Image(self.site, name, info)
			else:
				return page.Page(self.site, name, info)