kifield/kifield.py
def insert_part_fields_into_csv(
    part_fields_dict, filename, recurse, group_components, backup, no_range
):
    """Insert the fields in the extracted part dictionary into a CSV spreadsheet."""

    logger.log(
        DEBUG_OVERVIEW, "Inserting extracted fields into CSV file {}.".format(filename)
    )

    if backup:
        create_backup(filename)

    # Either insert fields into an existing workbook, or use an empty one.
    try:
        wb, dialect = csvfile_to_wb(filename)
    except IOError:
        wb = None
        if os.path.splitext(filename)[-1] == ".tsv":
            dialect = "excel-tab"
        else:
            dialect = "excel"

    wb = insert_part_fields_into_wb(part_fields_dict, wb)

    if group_components:
        wb = group_wb(wb, no_range)

    wb_to_csvfile(wb, filename, dialect)
Insert the fields in the extracted part dictionary into a CSV spreadsheet.
Insert the fields in the extracted part dictionary into a CSV spreadsheet.
Insert the fields in the extracted part dictionary into a CSV spreadsheet .
def insert_part_fields_into_csv(
    part_fields_dict, filename, recurse, group_components, backup, no_range
):
    logger.log(
        DEBUG_OVERVIEW, "Inserting extracted fields into CSV file {}.".format(filename)
    )
    if backup:
        create_backup(filename)
    try:
        wb, dialect = csvfile_to_wb(filename)
    except IOError:
        wb = None
        if os.path.splitext(filename)[-1] == ".tsv":
            dialect = "excel-tab"
        else:
            dialect = "excel"
    wb = insert_part_fields_into_wb(part_fields_dict, wb)
    if group_components:
        wb = group_wb(wb, no_range)
    wb_to_csvfile(wb, filename, dialect)
def insert_part_fields_into_csv ( part_fields_dict , filename , recurse , group_components , backup , no_range ) : logger . log ( DEBUG_OVERVIEW , "Inserting extracted fields into CSV file {}." . format ( filename ) ) if backup : create_backup ( filename ) try : wb , dialect = csvfile_to_wb ( filename ) except IOError : wb = None if os . path . splitext ( filename ) [ - 1 ] == ".tsv" : dialect = "excel-tab" else : dialect = "excel" wb = insert_part_fields_into_wb ( part_fields_dict , wb ) if group_components : wb = group_wb ( wb , no_range ) wb_to_csvfile ( wb , filename , dialect )
Insert the fields in the extracted part dictionary into a CSV spreadsheet.
Insert the fields in the extracted part dictionary into a CSV spreadsheet .
"""Insert the fields in the extracted part dictionary into a CSV spreadsheet.""" # Either insert fields into an existing workbook, or use an empty one.
part_fields_dict
filename
recurse
group_components
backup
no_range