def recase_file(file_dict):
    'Recase file before writing to output.'
    if (('packages' in file_dict) or ('dev-packages' in file_dict)):
        sections = ('packages', 'dev-packages')
    elif (('default' in file_dict) or ('develop' in file_dict)):
        sections = ('default', 'develop')
    for section in sections:
        file_section = file_dict.get(section, {})
        for key in list(file_section.keys()):
            try:
                cased_key = proper_case(key)
            except IOError:
                cased_key = key
            file_section[cased_key] = file_section.pop(key)
    return file_dict
Recase file before writing to output.
def recase_file(file_dict):
    
    if (('packages' in file_dict) or ('dev-packages' in file_dict)):
        sections = ('packages', 'dev-packages')
    elif (('default' in file_dict) or ('develop' in file_dict)):
        sections = ('default', 'develop')
    for section in sections:
        file_section = file_dict.get(section, {})
        for key in list(file_section.keys()):
            try:
                cased_key = proper_case(key)
            except IOError:
                cased_key = key
            file_section[cased_key] = file_section.pop(key)
    return file_dict