parameters: (source_folders, destination_folder, reg_match=None, delete_copied_files=False, debug=False)
return_statement: return copied_files
docstring: Missing DocString
  
      :param source_folders:
      :param destination_folder:
      :param reg_match:
      :param delete_copied_files:
      :param debug:
      :return:
docstring_summary: Missing DocString
docstring_tokens: Missing DocString
function: def copy_directory(source_folders, destination_folder, reg_match=None, delete_copied_files=False, debug=False):
      """Missing DocString
  
      :param source_folders:
      :param destination_folder:
      :param reg_match:
      :param delete_copied_files:
      :param debug:
      :return:
      """
      copied_files = 0
  
      # That it can it can also work when "source_folders" is not a list
      if type(source_folders) is not list:
          source_folders = [source_folders]
  
      # Make sure the destination directory really exits
      if not os.path.isdir(destination_folder):
          creation_status = createFolder(destination_folder, writeToAll=True)
  
          if creation_status:
              if debug:
                  print("The Destination-Folder did not exist and did get "
                        "created: %s" % destination_folder)
          else:
              print("Warning: The following Destination-Folder could not get "
                    "created so the files could not get copied: %s" %
                    destination_folder)
              return copied_files
  
      # Go through all source-folders
      for source_folder in source_folders:
          # Exit when the source_folder does not exist or is no folder
          if not os.path.isdir(source_folder):
              print("Warning: Source-Folder could not get copied because it is "
                    "either no folder or it does not exist: %s" % source_folder)
              return copied_files
  
          # Get the directory content, files & folders
          listing = os.listdir(source_folder)
  
          # Go through all files & directories in source-directory
          for file_name in listing:
              # First check if it is file or directory
              if os.path.isdir(os.path.join(source_folder, file_name)):
                  # When it is directory call itself with new parameters
                  copied_files += copy_directory(
                      os.path.join(source_folder, file_name),
                      os.path.join(destination_folder, file_name),
                      delete_copied_files=delete_copied_files, debug=debug)
              else:
                  # When it is a file
                  if reg_match:
                      # When reg_match is given if the file matches and if not
                      # skip it
                      if not re.match(reg_match, file_name):
                          continue
  
                  # Build the full-file-paths
                  source_file = os.path.join(source_folder, file_name)
                  destination_file = os.path.join(destination_folder, file_name)
  
                  # Call copy-function which only copies when file is newer
                  if copy_file(source_file, destination_file,
                               delete_original=delete_copied_files, debug=debug):
                      copied_files += 1
                  else:
                      continue
  
      return copied_files
function_tokens: def copy_directory ( source_folders , destination_folder , reg_match = None , delete_copied_files = False , debug = False ) : copied_files = 0 # That it can it can also work when "source_folders" is not a list if type ( source_folders ) is not list : source_folders = [ source_folders ] # Make sure the destination directory really exits if not os . path . isdir ( destination_folder ) : creation_status = createFolder ( destination_folder , writeToAll = True ) if creation_status : if debug : print ( "The Destination-Folder did not exist and did get " "created: %s" % destination_folder ) else : print ( "Warning: The following Destination-Folder could not get " "created so the files could not get copied: %s" % destination_folder ) return copied_files # Go through all source-folders for source_folder in source_folders : # Exit when the source_folder does not exist or is no folder if not os . path . isdir ( source_folder ) : print ( "Warning: Source-Folder could not get copied because it is " "either no folder or it does not exist: %s" % source_folder ) return copied_files # Get the directory content, files & folders listing = os . listdir ( source_folder ) # Go through all files & directories in source-directory for file_name in listing : # First check if it is file or directory if os . path . isdir ( os . path . join ( source_folder , file_name ) ) : # When it is directory call itself with new parameters copied_files += copy_directory ( os . path . join ( source_folder , file_name ) , os . path . join ( destination_folder , file_name ) , delete_copied_files = delete_copied_files , debug = debug ) else : # When it is a file if reg_match : # When reg_match is given if the file matches and if not # skip it if not re . match ( reg_match , file_name ) : continue # Build the full-file-paths source_file = os . path . join ( source_folder , file_name ) destination_file = os . path . join ( destination_folder , file_name ) # Call copy-function which only copies when file is newer if copy_file ( source_file , destination_file , delete_original = delete_copied_files , debug = debug ) : copied_files += 1 else : continue return copied_files