Commit graph

1179 commits

Author SHA1 Message Date
Henrik Levkowetz dd37257c0c Only print the first 100 lines of a long diff. New soup2html code for spacing associated with certain tags.
- Legacy-Id: 337
2007-06-12 17:52:07 +00:00
Henrik Levkowetz aba06af322 Another soup2html() tweak to better avoid indentation at paragraph start.
- Legacy-Id: 330
2007-06-12 01:32:05 +00:00
Henrik Levkowetz 541b041cdc soup2html() tweak to better avoid indentation at paragraph start.
- Legacy-Id: 329
2007-06-12 00:55:41 +00:00
Henrik Levkowetz 67eb998901 soup2html() tweak to handle html comments.
- Legacy-Id: 328
2007-06-12 00:37:16 +00:00
Henrik Levkowetz b15c02c830 soup2html() tweak to handle table cells.
- Legacy-Id: 326
2007-06-12 00:25:45 +00:00
Henrik Levkowetz bfcb0e6c78 Two soup2text tweaks.
- Legacy-Id: 324
2007-06-11 23:52:51 +00:00
Henrik Levkowetz 1cafcf3e9d Changed approach to space normalization in soup2text(). Plain whitespace stripping followed by reassembly caused too large information loss. Accompanying changes in generic diff files.
- Legacy-Id: 321
2007-06-11 20:28:19 +00:00
Henrik Levkowetz 8e8c3ff5e2 * ietf/tests.py: Remove filetime() again -- not using it.
* ietf/utils/soup2text.py: Do line ending normalization.
 - Legacy-Id: 315
2007-06-11 17:26:59 +00:00
Henrik Levkowetz 7f512b4889 make soup2text convert numeric character codes (e.g., "'") too.
- Legacy-Id: 306
2007-06-11 07:47:56 +00:00
Henrik Levkowetz 0452fca7d2 * ietf/tests.py, in reduce(): add ad-hoc fix for pathologic case of not
closing <li> tags.  BeautifulSoup can handle it, but the recursive text
   rendering code in soup2text recurses too deeply with a sufficiently long
   list...
 * ietf/tests.py, in setUp(): grab the right tuple element when extracting
   the URLs from the url test tuples
 * ietf/tests.py, in read_testurls(): close opened file
 * ietf/tests.py, in doUrlsTest(): narrower try/except clause, and a new one
 * soup2text.py, in para(): undo previous change
 - Legacy-Id: 304
2007-06-11 06:13:29 +00:00
Henrik Levkowetz b42e0728c8 Accept both testurl.list and testurls.list as test url list file names. Output status for good compares, too.
- Legacy-Id: 303
2007-06-11 04:43:22 +00:00
Henrik Levkowetz 9b78963547 Fix occasional bad sentence end merges in ietf/utils/soup2text.py.
Remove some now unneded exceptions from ietf/testurl.list
 - Legacy-Id: 302
2007-06-11 04:22:29 +00:00
Henrik Levkowetz a7a6d956af Adding a fix in soup2text for a common pathological case: <br><br> used instead
of <p /> to indicate paragraph breaks.

This changes the failed diff for /iesg/telechat/detail/354/ to show only three
differences, where two are whitespace differences and one shows a difference
between '@ietf.org. The' and '@ietf.org . The' and is an artifact of the text
extraction.  Will look at fixing that next.
 - Legacy-Id: 300
2007-06-11 03:36:08 +00:00
Henrik Levkowetz 7c60b321cd Add BeautifulSoup.py to the ietf/contrib/ directory so it doesn't have to be installed separately
- Legacy-Id: 289
2007-06-10 14:02:11 +00:00
Henrik Levkowetz 06eae09af4 Removing unused imports from ietf/tests.py. Using the right Exception type in soup2html.
- Legacy-Id: 283
2007-06-10 11:43:19 +00:00
Henrik Levkowetz 10ce0e07dd 'soup2text' is a html-to-text converter which uses the BeautifulSoup.py module. It converts html to plain paragraph-filled readable text.
- Legacy-Id: 277
2007-06-10 11:27:02 +00:00
Henrik Levkowetz 03c18bd33d Fixing a bunch of nits pyflakes were complaining about, in order to get a clean run. There are still at least 2 cases of using undefined values which needs scrutiny.
- Legacy-Id: 235
2007-06-05 16:58:58 +00:00
Henrik Levkowetz 5c9e46027b Try to make the utils/listop functions return something sensible with empty input.
- Legacy-Id: 233
2007-06-05 15:05:31 +00:00
Henrik Levkowetz 8ff20e3127 Expanded the test code which finds urlpatterns to extract all URLs
specified in the various Django apps of the site.  Also fixed the
documentation of the TemplatedForm factory to be more correct.
 - Legacy-Id: 227
2007-06-04 19:26:16 +00:00
Bill Fenner cae902a373 Add two middleware classes:
- SQLLogMiddleware.  This logs any INSERT or UPDATE performed by
a request.

- SMTPExceptionMiddleware.  This renders a "please try again"
(template email_failed.html) message when an attempt to send
email failed.  This uses a bit of a hack, in that the middleware
looks explicitly for smtplib.SMTPException, and smtplib can
raise other exceptions (particularly socket errors).  utils/mail/send_smtp
catches all exceptions and reraises non-smtplib exceptions as
fake smtplib exceptions, and the middleware undoes the wrapping.
 - Legacy-Id: 224
2007-06-04 13:52:34 +00:00
Bill Fenner 8628844700 Remove CRs from subject that comes from a template.
- Legacy-Id: 211
2007-06-01 20:40:02 +00:00
Bill Fenner 6072945ba4 Handle, log, and reraise an smtplib exception.
- Legacy-Id: 201
2007-06-01 02:10:26 +00:00
Henrik Levkowetz 4a289b821f Minor cleanup based on pyflakes feedback
- Legacy-Id: 188
2007-05-31 09:44:12 +00:00
Henrik Levkowetz 4aa8b5810a Separating out utility functions into their own files.
- Legacy-Id: 168
2007-05-28 09:17:30 +00:00
Bill Fenner edd08f3d10 Log sent mail.
Use the right template for the subject.
 - Legacy-Id: 164
2007-05-24 20:38:27 +00:00
Bill Fenner 78186c7406 Use the "standard" django way to get at the settings.
- Legacy-Id: 162
2007-05-24 17:36:25 +00:00
Bill Fenner 19d77b754a Add mail-sending module. It uses the django settings file for several
bits of configuration (e.g., mail server, any authentication required,
etc.)  It has different behavior based on the setting of the
SERVER_MODE setting:

 - 'development' or 'test': the message will be sent as an attachment
   to ietf.tracker.archive+SERVER_MODE@gmail.com; the actual destination
   supplied won't be used.

 - 'production': the message will be sent to the addressees and a
   copy sent to ietf.tracker.archive+production@gmail.com .

There are several functions to call, depending on what you want
to pass:

 - send_mail_text() takes a request, "To:" list, From header (or None
   to default), Subject text, Body text, an optional Cc: list, and
   an optional dict with extra headers.

 - send_mail() takes a template and a context instead of the body text,
   and renders the template with the given context.

 - send_mail_subj() takes a template for the subject as well as for the
   body.  It uses the same context to render both templates.
 - Legacy-Id: 159
2007-05-24 17:17:47 +00:00
Henrik Levkowetz 8d7053fc5c * Removed InternationalPhoneNumber class, instead using the form creation
callback to provide a RegexpField class.
 * Added checkbox for submitter contact information being the same as
   IETF contact information; with javascript support and validation
   support.
 * Cleaned out the old split_form() and mk_formatting_form() functions from
   ietf.utils.
 - Legacy-Id: 138
2007-05-18 15:50:30 +00:00
Henrik Levkowetz cf20093762 * Moved utility functions into utils/ directory, and started breaking out
utilities into separate files.
 * Added a log() function in ietf/utils.  It uses syslog, but adds some
   information about where it was called from.
 - Legacy-Id: 130
2007-05-11 15:48:45 +00:00