FTP problems uploading gauges.min.js - exceeds line character limit in ftplib

Forums:

Due to the fact that gauges.min.js contains no line wraps it will fail if you try to upload it via FTP within the quickCPM app.
I do not recall the exact error message but it mentions exceeding the amount of characters limit for a line.
This is due to a per line character limit in ftplib.
If you have an editor that allows replacement with new line you can just do a search for semi-colon and replace
them with "semi-colon\n" (\n = new line).

You can download the new line replacement script below.
If you would like to write your own python script to parse the js file, it can be done easily using the following:

# ftrim.py
import os
os.chdir(r"/home/pi/bin/quickcpm")
with open("gauge.min.js",'r') as f:
rd = f.read().replace(";",";\n")
f.close()
g=open('gauge.min.js','w')
g.write(rd)
g.close()

Just replace the chdir path to the path where your file resides and change the open statement file name.
What it does is simply replace everywhere there is a semi-colon with a carriage return and then save the file.

Once the js file "new lines" are added it should allow you to ftp the js file.

37.8269817,-122.4251495,06-17-2019 10:18:46 AM,!On a treasure hunt