(dos_name)
return norm_name
Convert dosname into bytes uppercase 8.3.
Convert dosname into bytes uppercase 8.3.
Convert dosname into bytes uppercase 8 . 3 .
def dos_normalise_name(dos_name):
    """Convert dosname into bytes uppercase 8.3."""
    # a normalised DOS-name is all-uppercase, no leading or trailing spaces, and
    # 1) . or ..; or
    # 2) 0--8 allowable characters followed by one dot followed by 0--3 allowable characters; or
    # 3) 1--8 allowable characters with no dots
    #
    # don't try to split special directory names
    if dos_name in (b'.', b'..'):
        return dos_name
    # convert to all uppercase
    dos_name = dos_name.upper()
    # split into trunk and extension
    trunk, ext = dos_splitext(dos_name)
    # truncate to 8.3
    trunk, ext = trunk[:8], ext[:3]
    if ext:
        ext = b'.' + ext
    norm_name = trunk + ext
    return norm_name
def dos_normalise_name ( dos_name ) : # a normalised DOS-name is all-uppercase, no leading or trailing spaces, and # 1) . or ..; or # 2) 0--8 allowable characters followed by one dot followed by 0--3 allowable characters; or # 3) 1--8 allowable characters with no dots # # don't try to split special directory names if dos_name in ( b'.' , b'..' ) : return dos_name # convert to all uppercase dos_name = dos_name . upper ( ) # split into trunk and extension trunk , ext = dos_splitext ( dos_name ) # truncate to 8.3 trunk , ext = trunk [ : 8 ] , ext [ : 3 ] if ext : ext = b'.' + ext norm_name = trunk + ext return norm_name