r96353 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96352‎ | r96353 | r96354 >
Date:17:53, 6 September 2011
Author:ariel
Status:deferred
Tags:
Comment:
missing parens in usage message; add 'latestlinks' option to just redo links and rss feed files in 'latest' directory; don't cleanup/delete for noop
Modified paths:
  • /branches/ariel/xmldumps-backup/worker.py (modified) (history)

Diff [purge]

Index: branches/ariel/xmldumps-backup/worker.py
@@ -505,6 +505,7 @@
506506 if (self._singleJob[-5:] == 'table' or
507507 self._singleJob[-9:] == 'recombine' or
508508 self._singleJob == 'noop' or
 509+ self._singleJob == 'latestlinks' or
509510 self._singleJob == 'xmlpagelogsdump' or
510511 self._singleJob == 'pagetitlesdump' or
511512 self._singleJob.endswith('recombine')):
@@ -514,6 +515,7 @@
515516 if (self._singleJob[-5:] == 'table' or
516517 self._singleJob[-9:] == 'recombine' or
517518 self._singleJob == 'noop' or
 519+ self._singleJob == 'latestlinks' or
518520 self._singleJob == 'xmlpagelogsdump' or
519521 self._singleJob == 'pagetitlesdump' or
520522 self._singleJob == 'abstractsdump' or
@@ -651,11 +653,12 @@
652654 if (item.name() == job):
653655 item.setToBeRun(True)
654656 return True
655 - if job == "noop":
 657+ if job == "noop" or job == "latestlinks":
656658 return True
657659 print "No job of the name specified exists. Choose one of the following:"
658 - print "noop (runs no job but rewrites md5sums file and resets latest links"
659 - print "tables (includes all items below that end in 'table'"
 660+ print "noop (runs no job but rewrites md5sums file and resets latest links)"
 661+ print "latestlinks (runs no job but resets latest links)"
 662+ print "tables (includes all items below that end in 'table')"
660663 for item in self.dumpItems:
661664 print "%s " % item.name()
662665 return False
@@ -1518,6 +1521,22 @@
15191522 self._cleanupOldFilesEnabled = False
15201523
15211524 self.jobRequested = job
 1525+
 1526+ if self.jobRequested == "latestlinks":
 1527+ self._statusEnabled = False
 1528+ self._checksummerEnabled = False
 1529+ self._runInfoFileEnabled = False
 1530+ self._noticeFileEnabled = False
 1531+ self._makeDirEnabled = False
 1532+ self._cleanOldDumpsEnabled = False
 1533+ self._cleanupOldFilesEnabled = False
 1534+ self._checkForTruncatedFilesEnabled = False
 1535+
 1536+ if self.jobRequested == "noop":
 1537+ self._cleanOldDumpsEnabled = False
 1538+ self._cleanupOldFilesEnabled = False
 1539+ self._checkForTruncatedFilesEnabled = False
 1540+
15221541 self.dbServerInfo = DbServerInfo(self.wiki, self.dbName, self.logAndPrint)
15231542 self.dumpDir = DumpDir(self.wiki, self.dbName)
15241543
@@ -1877,7 +1896,7 @@
18781897 for f in files:
18791898 if f.endswith("-rss.xml"):
18801899 filename = f[:-8];
1881 - link = os.path.join(latestDir,filename)
 1900+ link = os.path.join(latestDir,f)
18821901 if not exists(link):
18831902 os.remove(os.path.join(latestDir,f))
18841903

Status & tagging log