Thread:Manual talk:Pywikipediabot/NameError: global name 'appendtops' is not defined/reply (4)

Could you write the solution to the problem here?

What I did was I changed these lines of code: if self.append == "Top": if appendtops.find(self.nocontents)==-1 and appendtops.find(self.nocontents.lower)==-1: contents=contents +appendtops pywikibot.output(u"Page %s already exists, appending on top!"                                % title) else: pywikibot.output(u'Page had %s so it is skipped' % (self.nocontents)) return contents = contents + page.get comment = comment_top elif self.append == "Bottom": if appendtops.find(self.nocontents)==-1 and appendtops.find(self.nocontents.lower)==-1: contents=contents +appendtops pywikibot.output(u"Page %s already exists, appending on bottom!"                                % title) else: pywikibot.output(u'Page had %s so it is skipped' % (self.nocontents)) return contents = page.get + contents comment = comment_bottom

to if self.append == "Top": contents = contents + page.get comment = comment_top elif self.append == "Bottom": contents = page.get + contents comment = comment_bottom