unchunk.py
def unchunkSubfolders(source=SOURCEFOLDER, destination=TARGETFOLDER, copyCommand=COMMAND, endWithPause=True, dumbDownPrompt=True):
    """
    change into topfolder
    get all the directories
    jump into each one,
    and execute unchunkFiles() there
    
    print all commands onto screen
    and into outfile o
    
    then close o
    """
    
    # this folder contains all the movie subfolders:
    os.chdir(source)
    
    # get the names of the movie subfolders:
    dirs=[ name for name in os.listdir(".") 
           if os.path.isdir(os.path.join(".", name)) 
          ]
    
    outfile=open(BATFILE,"w") # for writing
    
    def p(command, toScreen=True):
      "print and save the command"
      outfile.write(command + "\n")
      if toScreen: print command
    
    if dumbDownPrompt: p("prompt $g")
    
    for folder in dirs:

        # into folder:
        os.chdir(folder)
        c = "cd %s" % folder
        p(c)
    
        # create copy command
        c=unchunkFiles(destination=destination, copyCommand=copyCommand)
        p(c)

        # out of folder
        os.chdir("..")
        c = "cd .."
        p(c)
        
    # there are some good people out there.
    p("@echo .", False)
    p("@echo .", False)
    p("@echo . Ready.")    
    p("@echo . If you like this, show it: [BTC] %s - thanks." % DONATION)
    p("@echo .", False)  
    
    if endWithPause:
      # keep the window open when ready
      p("pause")    
    
    # close the written batch file:
    outfile.close()

    change into topfolder
    get all the directories
    jump into each one,
    and execute unchunkFiles() there
    
    print all commands onto screen
    and into outfile o
    
    then close o
    
change into topfolder
get all the directories
jump into each one,
and execute unchunkFiles() there

print all commands onto screen
and into outfile o

then close o
change into topfolder get all the directories jump into each one and execute unchunkFiles () there print all commands onto screen and into outfile o then close o
def unchunkSubfolders(source=SOURCEFOLDER, destination=TARGETFOLDER, copyCommand=COMMAND, endWithPause=True, dumbDownPrompt=True):
    os.chdir(source)
    dirs=[ name for name in os.listdir(".") 
           if os.path.isdir(os.path.join(".", name)) 
          ]
    outfile=open(BATFILE,"w") 
    def p(command, toScreen=True):
      outfile.write(command + "\n")
      if toScreen: print command
    if dumbDownPrompt: p("prompt $g")
    for folder in dirs:
        os.chdir(folder)
        c = "cd %s" % folder
        p(c)
        c=unchunkFiles(destination=destination, copyCommand=copyCommand)
        p(c)
        os.chdir("..")
        c = "cd .."
        p(c)
    p("@echo .", False)
    p("@echo .", False)
    p("@echo . Ready.")    
    p("@echo . If you like this, show it: [BTC] %s - thanks." % DONATION)
    p("@echo .", False)  
    if endWithPause:
      p("pause")    
    outfile.close()
def unchunkSubfolders ( source = SOURCEFOLDER , destination = TARGETFOLDER , copyCommand = COMMAND , endWithPause = True , dumbDownPrompt = True ) : os . chdir ( source ) dirs = [ name for name in os . listdir ( "." ) if os . path . isdir ( os . path . join ( "." , name ) ) ] outfile = open ( BATFILE , "w" ) def p ( command , toScreen = True ) : "print and save the command" outfile . write ( command + "\n" ) if toScreen : print command if dumbDownPrompt : p ( "prompt $g" ) for folder in dirs : os . chdir ( folder ) c = "cd %s" % folder p ( c ) c = unchunkFiles ( destination = destination , copyCommand = copyCommand ) p ( c ) os . chdir ( ".." ) c = "cd .." p ( c ) p ( "@echo ." , False ) p ( "@echo ." , False ) p ( "@echo . Ready." ) p ( "@echo . If you like this, show it: [BTC] %s - thanks." % DONATION ) p ( "@echo ." , False ) if endWithPause : p ( "pause" ) outfile . close ( )
change into topfolder
get all the directories
jump into each one,
and execute unchunkFiles() there
change into topfolder get all the directories jump into each one and execute unchunkFiles () there
"""
    change into topfolder
    get all the directories
    jump into each one,
    and execute unchunkFiles() there
    
    print all commands onto screen
    and into outfile o
    
    then close o
    """ # this folder contains all the movie subfolders: # get the names of the movie subfolders: # for writing "print and save the command" # into folder: # create copy command # out of folder # there are some good people out there. # keep the window open when ready # close the written batch file:
source
destination
copyCommand
endWithPause
dumbDownPrompt