Revision: 4205 Author: wikipedian Date: 2007-09-07 09:43:40 +0000 (Fri, 07 Sep 2007)
Log Message: ----------- reverted, reintroducing without_interwiki config option, as per request in [ pywikipediabot-Feature Requests-1789962 ]
Modified Paths: -------------- trunk/pywikipedia/config.py trunk/pywikipedia/interwiki.py
Modified: trunk/pywikipedia/config.py =================================================================== --- trunk/pywikipedia/config.py 2007-09-06 22:16:48 UTC (rev 4204) +++ trunk/pywikipedia/config.py 2007-09-07 09:43:40 UTC (rev 4205) @@ -211,6 +211,9 @@ # 'http://www.example.org/~yourname/interwiki-graphs/' interwiki_graph_url = None
+# Save file with local articles without interwikis. +without_interwiki = False + ############## SOLVE_DISAMBIGUATION SETTINGS ############ # # Set disambiguation_comment[FAMILY][LANG] to a non-empty string to override
Modified: trunk/pywikipedia/interwiki.py =================================================================== --- trunk/pywikipedia/interwiki.py 2007-09-06 22:16:48 UTC (rev 4204) +++ trunk/pywikipedia/interwiki.py 2007-09-07 09:43:40 UTC (rev 4205) @@ -186,6 +186,8 @@
interwiki_graph_format: the file format for interwiki graphs
+without_interwiki: save file with local articles without interwikis + All these options can be changed through the user-config.py configuration file.
If interwiki.py is terminated before it is finished, it will write a dump file @@ -577,6 +579,13 @@ return True return False
+ def reportInterwikilessPage(self, page): + wikipedia.output(u"NOTE: %s does not have any interwiki links" % self.originPage.aslink(True)) + if config.without_interwiki: + f = codecs.open('without_interwiki.txt', 'a', 'utf-8') + f.write("# %s \n" % page.aslink()) + f.close() + def askForHints(self, counter): if (self.untranslated or globalvar.askhints) and not self.hintsAsked and not self.originPage.isRedirectPage(): # Only once! @@ -704,7 +713,7 @@ self.pending = [] # Check whether we need hints and the user offered to give them if self.untranslated and not self.hintsAsked: - wikipedia.output(u"NOTE: %s does not have any interwiki links" % self.originPage.aslink(True)) + self.reportInterwikilessPage(page) self.askForHints(counter)
def isDone(self):