From 20ab3b377b8828acf93ffd4e963f7e5f8029e1f7 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Tue, 29 May 2012 23:52:07 -0400 Subject: Transmission from the CGI was successful. --- www/gps_report.cgi.in | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'www/gps_report.cgi.in') diff --git a/www/gps_report.cgi.in b/www/gps_report.cgi.in index 0f0cfcfd..fbdd6f88 100644 --- a/www/gps_report.cgi.in +++ b/www/gps_report.cgi.in @@ -67,27 +67,23 @@ formfields = ("submitter", ) if hasRequiredElements(form) and form.getvalue("action") == "Send Report": - print cgi.print_form(form) msg = "" report = MIMEMultipart() report['Subject'] = 'New device report' report['To'] = to_address report.preamble = "Part 1 is form data, part 2 is the sample" - for field in formfields and not field.startswith('output_sample'): - if form.getvalue(field): + for field in formfields: + if form.getvalue(field) and not field.startswith('output_sample'): msg += "%s: %s\n" % (field, form.getvalue(field)) report.attach(MIMEText(msg)) content = MIMEText(output_sample_content) encode_base64(content) report.attach(content) - print "
"
-    print report.as_string()
-    print "
" - msg = "This is only a test" - #smtp = smtplib.SMTP(host=servaddr.split("@")[1]) - #smtp.set_debuglevel(1) - #smtp.sendmail(servaddr, ["esr@thyrsus.com"], msg) - #smtp.quit() + msg = report.as_string() + smtp = smtplib.SMTP(host=servaddr.split("@")[1]) + smtp.set_debuglevel(1) + smtp.sendmail(servaddr, ["esr@thyrsus.com"], msg) + smtp.quit() print "

New device report accepted. Thanks for helping improve GPSD.\n"; sys.exit(0) @@ -123,10 +119,6 @@ print '''

GPSD Receiver Reporting Form

-

NOTE: Due to a Perl dependency coming unstuck, this form is in the -process of being translated to Python and is not presently complete or -usable. The management regrets any inconvenience.

-

Please use this form to report gpsd successes or -- cgit v1.2.1