def build_command_list(inkscape_path, svg_path, png_path, width_px, height_px, dpi, export_area):
    """Build a list of shell commands needed to export an Inkscape svg."""
    # For more params, see https://inkscape.org/en/doc/inkscape-man.html
    shell_command_as_list = [
        inkscape_path,
        "--without-gui",
        "--export-area=%s" % export_area if export_area else "--export-area-page",
        "--export-png=%s" % png_path]

    if dpi:
        shell_command_as_list.append("--export-dpi=%d" % dpi)
    else:
        shell_command_as_list.append("--export-width=%d" % width_px) # Floats not supported.
        shell_command_as_list.append("--export-height=%d" % height_px) # Floats not supported.

    shell_command_as_list.append(svg_path)

    return shell_command_as_list