daily pastebin goal
89%
SHARE
TWEET

Untitled

a guest Jan 12th, 2018 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/python -tt
  2.  
  3. def main():
  4.  
  5.   import os, shutil
  6.  
  7.   dir = "courses"
  8.   compiled = "output"
  9.   series = "h"
  10.  
  11.   for i in os.listdir(dir):
  12.     # check series (f, r, h)
  13.     if i[0:1] == series:
  14.       print
  15.       print "======================="
  16.       print "Course " + i
  17.       print "======================="
  18.      
  19.       #=======================
  20.       # course upgrades
  21.       #=======================
  22.  
  23.       print "Upgrading engines"
  24.       shutil.copyfile(compiled + "/" + series + "/templates/USP6wClickToReveal.swf", dir + "/" + i + "/config/templates/USP6wClickToReveal.swf")
  25.       shutil.copyfile(compiled + "/" + series + "/templates/USP6wClickToScroll.swf", dir + "/" + i + "/config/templates/USP6wClickToScroll.swf")
  26.       shutil.copyfile(compiled + "/" + series + "/templates/USP6wClickToZoom.swf", dir + "/" + i + "/config/templates/USP6wClickToZoom.swf")
  27.       shutil.copyfile(compiled + "/" + series + "/templates/USP6wPanelEngine.swf", dir + "/" + i + "/config/templates/USP6wPanelEngine.swf")
  28.       shutil.copyfile(compiled + "/" + series + "/templates/USP6wRoleplay.swf", dir + "/" + i + "/config/templates/USP6wRoleplay.swf")
  29.       shutil.copyfile(compiled + "/" + series + "/templates/USP6wSmithAndJones.swf", dir + "/" + i + "/config/templates/USP6wSmithAndJones.swf")
  30.       shutil.copyfile(compiled + "/" + series + "/templates/USP6wTrolleyDash.swf", dir + "/" + i + "/config/templates/USP6wTrolleyDash.swf")
  31.       shutil.copyfile(compiled + "/" + series + "/templates/USP6wVideo.swf", dir + "/" + i + "/config/templates/USP6wVideo.swf")
  32.       shutil.copyfile(compiled + "/" + series + "/templates/USP6wWalkThroughAndSpot.swf", dir + "/" + i + "/config/templates/USP6wWalkThroughAndSpot.swf")
  33.       shutil.copyfile(compiled + "/" + series + "/templates/USP6wSoftwareSim.swf", dir + "/" + i + "/config/templates/USP6wSoftwareSim.swf")
  34.       shutil.copyfile(compiled + "/" + series + "/templates/USP6wLearnAndDecide.swf", dir + "/" + i + "/config/templates/USP6wLearnAndDecide.swf")
  35.      
  36.       print "Upgrading branding"
  37.       shutil.copyfile(compiled + "/" + series + "/logo.swf", dir + "/" + i + "/config/logo.swf")
  38.       shutil.copyfile(compiled + "/" + series + "/branding/USP6w_audioSplash.swf", dir + "/" + i + "/config/branding/USP6w/USP6w_audioSplash.swf")
  39.       shutil.copyfile(compiled + "/" + series + "/branding/USP6w_bg.swf", dir + "/" + i + "/config/branding/USP6w/USP6w_bg.swf")
  40.       shutil.copyfile(compiled + "/" + series + "/branding/USP6w_nav.swf", dir + "/" + i + "/config/branding/USP6w/USP6w_nav.swf")
  41.  
  42.       print "Upgrading player"
  43.       shutil.copyfile(compiled + "/genRTPlayer.swf", dir + "/" + i + "/genRTPlayer.swf")
  44.       shutil.copyfile(compiled + "/IF_USPLMS_5-4.swf", dir + "/" + i + "/IF_USPLMS_5-4.swf")
  45.       shutil.copyfile(compiled + "/boot.txt", dir + "/" + i + "/boot.txt")
  46.      
  47.       #=======================
  48.       # module based upgrades
  49.       #=======================
  50.      
  51.       for ii in os.listdir(dir + "/" + i):
  52.         if ii[0:6] == "module":
  53.          
  54.           print "Upgrading index.html in " + ii
  55.           shutil.copyfile(compiled + "/index.html", dir + "/" + i + "/" + ii + "/index.html")
  56.          
  57.           print "Upgrading imagePlugin.swf in " + ii + "/images/en"
  58.           shutil.copyfile(compiled + "/imagePlugin.swf", dir + "/" + i + "/" + ii + "/images/en/imagePlugin.swf")
  59.          
  60.           if os.path.exists(dir + "/" + i + "/" + ii + "/quizBranding.swf") == True:
  61.             files = os.listdir(dir + "/" + i + "/" + ii + "/")
  62.             file_list=[]
  63.             for file in files:
  64.               if file[-3:] == "swf" and file[-7:-4].isdigit() == True:
  65.                 file_list.append(file)
  66.                
  67.             last_file = file_list[len(file_list)-1]
  68.  
  69.             print "Upgrading quiz " + ii + " - " + last_file
  70.             shutil.copyfile(compiled + "/quiz.swf", dir + "/" + i + "/" + ii + "/" + last_file)
  71.             shutil.copyfile(compiled + "/" + series + "/quizBranding.swf", dir + "/" + i + "/" + ii + "/quizBranding.swf")
  72.  
  73. if __name__ == '__main__':
  74.   main()
RAW Paste Data
Top