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