original_docstring: ISO converter utility.
  
    Convert contents to ISO format checking the systems platform where the tool
    is being run.
  
    Args:
      source: path to directory with content to be converted
      destination: path to destination where the ISO file is written
      filelist: TBD
    
docstring: ISO converter utility.
  Convert contents to ISO format checking the systems platform where the tool
  is being run.
docstring_tokens: ISO converter utility . Convert contents to ISO format checking the systems platform where the tool is being run .
code: def to_iso(source, destination, filelist=None):
    """ISO converter utility.
  
    Convert contents to ISO format checking the systems platform where the tool
    is being run.
  
    Args:
      source: path to directory with content to be converted
      destination: path to destination where the ISO file is written
      filelist: TBD
    """
    # overwrite existing ISO file
    if isfile(destination):
      unlink(destination)
  
    if filelist:
      # create tmp dir
      tmpdir = mkdtemp()
      for item in filelist:
        rel = item[len(source)+1:]
        dst = join(tmpdir, rel)
  
        if not isdir(dirname(dst)):
          makedirs(dirname(dst))
  
        if not isdir(item):
          link(item, dst)
  
      source = tmpdir
  
    if platform.startswith("darwin"):
      system("hdiutil makehybrid -iso -joliet -o %s %s"%(destination, source))
      click.echo("Finished!")
    elif platform.startswith("linux"):
      system("mkisofs -r -J -o %s %s"%(destination, source))
      click.echo("Finished!")
    else:
      click.echo(platform + (" not supported for converting to ISO files."
                             "Try to download ISO maker tool from "
                             "'http://www.magiciso.com/tutorials/"
                             "miso-iso-creator.htm'"))
      logging.debug(platform + (" not supported for converting to ISO files."
                                "Try to download ISO maker tool from "
                                "'http://www.magiciso.com/tutorials/"
                                "miso-iso-creator.htm'"))
code_tokens: def to_iso ( source , destination , filelist = None ) : if isfile ( destination ) : unlink ( destination ) if filelist : tmpdir = mkdtemp ( ) for item in filelist : rel = item [ len ( source ) + 1 : ] dst = join ( tmpdir , rel ) if not isdir ( dirname ( dst ) ) : makedirs ( dirname ( dst ) ) if not isdir ( item ) : link ( item , dst ) source = tmpdir if platform . startswith ( "darwin" ) : system ( "hdiutil makehybrid -iso -joliet -o %s %s" % ( destination , source ) ) click . echo ( "Finished!" ) elif platform . startswith ( "linux" ) : system ( "mkisofs -r -J -o %s %s" % ( destination , source ) ) click . echo ( "Finished!" ) else : click . echo ( platform + ( " not supported for converting to ISO files." "Try to download ISO maker tool from " "'http://www.magiciso.com/tutorials/" "miso-iso-creator.htm'" ) ) logging . debug ( platform + ( " not supported for converting to ISO files." "Try to download ISO maker tool from " "'http://www.magiciso.com/tutorials/" "miso-iso-creator.htm'" ) )
short_docstring: ISO converter utility.
short_docstring_tokens: ISO converter utility .
comment: """ISO converter utility.
  
    Convert contents to ISO format checking the systems platform where the tool
    is being run.
  
    Args:
      source: path to directory with content to be converted
      destination: path to destination where the ISO file is written
      filelist: TBD
    """$SEP$# overwrite existing ISO file$SEP$# create tmp dir