Index: trunk/backup/WikiDump.py |
— | — | @@ -205,6 +205,9 @@ |
206 | 206 | def privateDir(self): |
207 | 207 | return os.path.join(self.config.privateDir, self.dbName) |
208 | 208 | |
| 209 | + def webDir(self): |
| 210 | + return "/".join((self.config.webRoot, self.dbName)) |
| 211 | + |
209 | 212 | # Actions! |
210 | 213 | |
211 | 214 | def lock(self): |
Index: trunk/backup/worker.py |
— | — | @@ -170,6 +170,9 @@ |
171 | 171 | def latestPath(self, filename): |
172 | 172 | return self.buildPath(self.wiki.publicDir(), "latest", filename) |
173 | 173 | |
| 174 | + def webPath(self, filename): |
| 175 | + return self.buildPath(self.wiki.webDir(), self.date, filename) |
| 176 | + |
174 | 177 | def makeDir(self, dir): |
175 | 178 | if exists(dir): |
176 | 179 | self.debug("Checkdir dir %s ..." % dir) |
— | — | @@ -404,7 +407,7 @@ |
405 | 408 | filepath = self.publicPath(file) |
406 | 409 | if status == "done" and exists(filepath): |
407 | 410 | size = prettySize(getsize(filepath)) |
408 | | - webpath = file |
| 411 | + webpath = self.webPath(file) |
409 | 412 | return "<li class='file'><a href=\"%s\">%s</a> %s</li>" % (webpath, file, size) |
410 | 413 | else: |
411 | 414 | return "<li class='missing'>%s</li>" % file |
— | — | @@ -487,9 +490,9 @@ |
488 | 491 | |
489 | 492 | def saveFeed(self, file): |
490 | 493 | self.makeDir(join(self.wiki.publicDir(), 'latest')) |
491 | | - webPath = "%s/%s/%s/" % (self.config.webRoot, self.dbName, self.date) |
492 | | - fileName = "%s-%s-%s" % (self.dbName, self.date, file) |
493 | | - filePath = webPath + fileName |
| 494 | + filePath = self.webPath(file) |
| 495 | + fileName = os.path.basename(filePath) |
| 496 | + webPath = os.path.dirname(filePath) |
494 | 497 | rssText = self.config.readTemplate("feed.xml") % { |
495 | 498 | "chantitle": file, |
496 | 499 | "chanlink": webPath, |