Revision: 4808 Author: leogregianin Date: 2008-01-05 12:00:04 +0000 (Sat, 05 Jan 2008)
Log Message: ----------- view page in browser or with gui
Modified Paths: -------------- trunk/pywikipedia/blockpageschecker.py
Modified: trunk/pywikipedia/blockpageschecker.py =================================================================== --- trunk/pywikipedia/blockpageschecker.py 2008-01-05 11:42:26 UTC (rev 4807) +++ trunk/pywikipedia/blockpageschecker.py 2008-01-05 12:00:04 UTC (rev 4808) @@ -225,18 +225,23 @@ else: wikipedia.output(u'No changes! Strange! Check the regex!') if debug == True: - quest = wikipedia.input(u'Do you want to open the page on your browser? [Y]es, [N]o: ') + quest = wikipedia.input(u'Do you want to open the page on your [b]rowser, [g]ui or [n]othing?') pathWiki = site.family.nicepath(site.lang) url = 'http://%s%s%s' % (wikipedia.getSite().hostname(), pathWiki, page.urlname()) while 1: - if quest.lower() in ['y', 'yes']: + if quest.lower() in ['b', 'B']: webbrowser.open(url) break - elif quest.lower() in ['n', 'no']: + elif quest.lower() in ['g', 'G']: + import editarticle + editor = editarticle.TextEditor() + text = editor.edit(page.get()) break + elif quest.lower() in ['n', 'N']: + break else: - wikipedia.output(u'wrong entry, type "yes" or "no"') - continue + wikipedia.output(u'wrong entry, type "b", "g" or "n"') + break
if __name__ == "__main__": try:
pywikipedia-l@lists.wikimedia.org