def __init__(self, source, title: str = ''): """Initializer. @param source: A Flow-enabled site or a Link or Page on such a site @type source: Site, pywikibot.page.Link, or pywikibot.page.Page @param title: normalized title of the page @raises TypeError: incorrect use of parameters @raises ValueError: use of non-Flow-enabled Site """ super().__init__(source, title) if not self.site.has_extension('Flow'): raise UnknownExtension('site is not Flow-enabled')
def __init__(self, source, title=''): """Constructor. @param source: A Flow-enabled site or a Link or Page on such a site @type source: Site, Link, or Page @param title: normalized title of the page @type title: unicode @raises TypeError: incorrect use of parameters @raises ValueError: use of non-Flow-enabled Site """ super(FlowPage, self).__init__(source, title) if not self.site.has_extension('Flow'): raise UnknownExtension('site is not Flow-enabled')
def callee(self, *args, **kwargs): if not self.has_extension(extension): raise UnknownExtension( 'Method "{}" is not implemented without the extension {}'. format(fn.__name__, extension)) return fn(self, *args, **kwargs)