http://www.mediawiki.org/wiki/Special:Code/MediaWiki/95404
Revision: 95404 Author: ariel Date: 2011-08-24 17:26:34 +0000 (Wed, 24 Aug 2011) Log Message: ----------- actually check user's y/n in a fashion that works; write dumpruninfo file in place, no need for temp file first Modified Paths: -------------- branches/ariel/xmldumps-backup/worker.py Modified: branches/ariel/xmldumps-backup/worker.py =================================================================== --- branches/ariel/xmldumps-backup/worker.py 2011-08-24 16:21:00 UTC (rev 95403) +++ branches/ariel/xmldumps-backup/worker.py 2011-08-24 17:26:34 UTC (rev 95404) @@ -395,7 +395,7 @@ directory = self._getDumpRunInfoDirName() dumpRunInfoFilename = self._getDumpRunInfoFileName() # FileUtils.writeFile(directory, dumpRunInfoFilename, text, self.wiki.config.fileperms) - FileUtils.writeFile(self.wiki.config.tempDir, dumpRunInfoFilename, text, self.wiki.config.fileperms) + FileUtils.writeFileInPlace(self.wiki.config.tempDir, dumpRunInfoFilename, text, self.wiki.config.fileperms) # format: name:%; updated:%; status:% def _getStatusForJobFromRunInfoFileLine(self, line, jobName): @@ -1646,7 +1646,7 @@ print "This means that the status information about the old run will be lost, and" print "only the information about the current (and future) runs will be kept." reply = raw_input("Continue anyways? [y/N]: ") - if (not reply in "y", "Y"): + if (not reply in [ "y", "Y" ]): raise RuntimeError( "No run information available for previous dump, exiting" ) if (not self.wiki.existsPerDumpIndex()): # AFAWK this is a new run (not updating or rerunning an old run), _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs