846 @exception OSError raised to indicate an issue with the device |
846 @exception OSError raised to indicate an issue with the device |
847 """ |
847 """ |
848 if not deviceFileName: |
848 if not deviceFileName: |
849 raise OSError("Missing device file name") |
849 raise OSError("Missing device file name") |
850 |
850 |
851 # convert eol '\r' |
851 # convert eol to '\n' |
852 content = content.replace(b"\r\n", b"\r") |
852 content = content.replace(b"\r\n", b"\n") |
853 content = content.replace(b"\n", b"\r") |
853 content = content.replace(b"\r", b"\n") |
854 |
854 |
855 commands = [ |
855 commands = [ |
856 "fd = open('{0}', 'wb')".format(deviceFileName), |
856 "fd = open('{0}', 'wb')".format(deviceFileName), |
857 "f = fd.write", |
857 "f = fd.write", |
858 ] |
858 ] |