Revision: 6771 Author: nicdumz Date: 2009-04-30 09:29:56 +0000 (Thu, 30 Apr 2009)
Log Message: ----------- Having a try at adding 'open in browser' option ( [ 2784183 ] open in browser with -confirm )
Modified Paths: -------------- trunk/pywikipedia/interwiki.py
Modified: trunk/pywikipedia/interwiki.py =================================================================== --- trunk/pywikipedia/interwiki.py 2009-04-30 09:21:06 UTC (rev 6770) +++ trunk/pywikipedia/interwiki.py 2009-04-30 09:29:56 UTC (rev 6771) @@ -310,6 +310,7 @@
import wikipedia, config, pagegenerators, catlib import titletranslate, interwiki_graph +import webbrowser
docuReplacements = { '&pagegenerators_help;': pagegenerators.parameterHelp @@ -1546,7 +1547,16 @@ # If we cannot ask, deny permission answer = 'n' else: - answer = wikipedia.inputChoice(u'Submit?', ['Yes', 'No', 'Give up'], ['y', 'n', 'g']) + answer = wikipedia.inputChoice(u'Submit?', + ['Yes', 'No', 'open in Browser', 'Give up'], + ['y', 'n', 'b', 'g']) + if choice == 'b': + webbrowser.open("http://%s%s" % ( + page.site().hostname(), + page.site().nice_get_address(page.title()) + )) + wikipedia.input("Press Enter when finished in browser.") + return True else: # If we do not need to ask, allow answer = 'y'
pywikipedia-svn@lists.wikimedia.org