docstamp/inkscape.py
def inkscape_export(input_file, output_file, export_flag="-A", dpi=90, inkscape_binpath=None):
    """ Call Inkscape to export the input_file to output_file using the
    specific export argument flag for the output file type.

    Parameters
    ----------

    input_file: str
        Path to the input file

    output_file: str
        Path to the output file

    export_flag: str
        Inkscape CLI flag to indicate the type of the output file

    Returns
    -------
    return_value
        Command call return value

    """
    if not os.path.exists(input_file):
        log.error('File {} not found.'.format(input_file))
        raise IOError((0, 'File not found.', input_file))

    if '=' not in export_flag:
        export_flag += ' '

    arg_strings = []
    arg_strings += ['--without-gui']
    arg_strings += ['--export-text-to-path']
    arg_strings += ['{}"{}"'.format(export_flag, output_file)]
    arg_strings += ['--export-dpi={}'.format(dpi)]
    arg_strings += ['"{}"'.format(input_file)]

    return call_inkscape(arg_strings, inkscape_binpath=inkscape_binpath)
def inkscape_export(input_file, output_file, export_flag="-A", dpi=90, inkscape_binpath=None):
    if not os.path.exists(input_file):
        log.error('File {} not found.'.format(input_file))
        raise IOError((0, 'File not found.', input_file))

    if '=' not in export_flag:
        export_flag += ' '

    arg_strings = []
    arg_strings += ['--without-gui']
    arg_strings += ['--export-text-to-path']
    arg_strings += ['{}"{}"'.format(export_flag, output_file)]
    arg_strings += ['--export-dpi={}'.format(dpi)]
    arg_strings += ['"{}"'.format(input_file)]

    return call_inkscape(arg_strings, inkscape_binpath=inkscape_binpath)
def inkscape_export ( input_file , output_file , export_flag = "-A" , dpi = 90 , inkscape_binpath = None ) : if not os . path . exists ( input_file ) : log . error ( 'File {} not found.' . format ( input_file ) ) raise IOError ( ( 0 , 'File not found.' , input_file ) ) if '=' not in export_flag : export_flag += ' ' arg_strings = [ ] arg_strings += [ '--without-gui' ] arg_strings += [ '--export-text-to-path' ] arg_strings += [ '{}"{}"' . format ( export_flag , output_file ) ] arg_strings += [ '--export-dpi={}' . format ( dpi ) ] arg_strings += [ '"{}"' . format ( input_file ) ] return call_inkscape ( arg_strings , inkscape_binpath = inkscape_binpath )
Call Inkscape to export the input_file to output_file using the
    specific export argument flag for the output file type.

    Parameters
    ----------

    input_file: str
        Path to the input file

    output_file: str
        Path to the output file

    export_flag: str
        Inkscape CLI flag to indicate the type of the output file

    Returns
    -------
    return_value
        Command call return value
Call Inkscape to export the input_file to output_file using the specific export argument flag for the output file type .