'Move the contents of source_dir to dest_dir, which might not exist.
Raises:
IOError: if the dest_dir hierarchy already contains a file where the
source_dir hierarchy has a file or directory of the same name, or if
the dest_dir hierarchy already contains a directory where the source_dir
hierarchy has a file of the same name.'

def _MoveDirectoryContents(self, source_dir, dest_dir):

    if (not os.path.exists(dest_dir)):
        os.mkdir(dest_dir)
    for entry in os.listdir(source_dir):
        source_entry = os.path.join(source_dir, entry)
        dest_entry = os.path.join(dest_dir, entry)
        if os.path.exists(dest_entry):
            if (os.path.isdir(source_entry) and os.path.isdir(dest_entry)):
                self._MoveDirectoryContents(source_entry, dest_entry)
            else:
                raise IOError(('Cannot    overwrite    existing    %s' % dest_entry))
        else:
            shutil.move(source_entry, dest_entry)
