SHOW:
|
|
- or go back to the newest paste.
| 1 | import es | |
| 2 | import path | |
| 3 | ||
| 4 | class DownloadHandler: | |
| 5 | downloads = [] | |
| 6 | ||
| 7 | @staticmethod | |
| 8 | - | def downloadAll(self): |
| 8 | + | def downloadAll(): |
| 9 | - | for d in self.downloads: |
| 9 | + | for d in DownloadHandler.downloads: |
| 10 | d.addDownload() | |
| 11 | ||
| 12 | class DownloadPath(path.path): | |
| 13 | ||
| 14 | basepath = str(es.ServerVar('eventscripts_gamedir'))
| |
| 15 | - | path.path.__init__(self, other) |
| 15 | + | |
| 16 | def __init__(self, other): | |
| 17 | path.path.__init__(self, str(self.basepath)) | |
| 18 | ||
| 19 | self.other = other | |
| 20 | - | for f in self.files(): |
| 20 | + | |
| 21 | - | es.stringtable('downloadables', str(f))
|
| 21 | + | |
| 22 | ||
| 23 | def addDownload(self): | |
| 24 | for f in (self / self.other).files(): | |
| 25 | es.stringtable('downloadables', str(f).split(str(self.basepath))[1])
| |
| 26 | ||
| 27 | ||
| 28 | # Bitte in diesem Bereich alle deine Pfade angeben, die heruntergeladen werden sollen. | |
| 29 | ||
| 30 | DownloadPath('maps')
| |
| 31 | DownloadPath('sound/ordner/und/so/weiter')
| |
| 32 | # DownloadPath('')
| |
| 33 | ||
| 34 | ||
| 35 | # Nichts Editieren! | |
| 36 | ||
| 37 | def es_map_start(ev): | |
| 38 | DownloadHandler.downloadAll() | |
| 39 | ||
| 40 | def load(): | |
| 41 | DownloadHandler.downloadAll() |