Advertisement
Brainsucker

Untitled

May 26th, 2013
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import es
  2. import path
  3.  
  4. class DownloadHandler:
  5.     downloads = []
  6.    
  7.     @staticmethod
  8.     def downloadAll():
  9.         for d in DownloadHandler.downloads:
  10.             d.addDownload()
  11.  
  12. class DownloadPath(path.path):
  13.  
  14.     basepath = str(es.ServerVar('eventscripts_gamedir'))
  15.    
  16.     def __init__(self, other):
  17.         path.path.__init__(self, str(self.basepath))
  18.        
  19.         self.other = other
  20.        
  21.         DownloadHandler.downloads.append(self)
  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()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement