Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #17158
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.glorb.com!news-out.readnews.com!news-xxxfer.readnews.com!panix!not-for-mail |
|---|---|
| From | Grant Edwards <invalid@invalid.invalid> |
| Newsgroups | comp.lang.python |
| Subject | Re: text to html |
| Date | Tue, 13 Dec 2011 18:14:06 +0000 (UTC) |
| Organization | PANIX Public Access Internet and UNIX, NYC |
| Lines | 27 |
| Message-ID | <jc84ld$59k$1@reader1.panix.com> (permalink) |
| References | <CAJyBqUfYV9V5eT=0Tf6p41k8Z2Z9VLyCZW=ZB5wyc01_aF9-xA@mail.gmail.com> <mailman.3609.1323797442.27778.python-list@python.org> |
| NNTP-Posting-Host | dsl.comtrol.com |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Content-Transfer-Encoding | 7bit |
| X-Trace | reader1.panix.com 1323800046 5428 64.122.56.22 (13 Dec 2011 18:14:06 GMT) |
| X-Complaints-To | abuse@panix.com |
| NNTP-Posting-Date | Tue, 13 Dec 2011 18:14:06 +0000 (UTC) |
| User-Agent | slrn/pre0.9.9-102 (Linux) |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.python:17158 |
Show key headers only | View raw
On 2011-12-13, Pedro Henrique Guedes Souto <pedro.h.souto@gmail.com> wrote:
> On Tue, Dec 13, 2011 at 3:22 PM, prakash jp <prakash.stack@gmail.com> wrote:
>
>> Want to publish a log file as a web page, is there a parser to retain
>> the format of the text as is and then convert to html. Please provide
>> the relevant pointers
>
>
> Hey, You can use this:?http://txt2tags.org/
I think thats a bit too likely to interpret stuff in the log messages
as formatting directives.
Two options come to mind:
1. Don't use HTML. Return the logfile as-is with Content-Type:
text/plain. [That way the user can also save it if needed.]
2. Escape the file contents using cgi.escape() and then stick the
escaped contents inside <pre> </pre> tags. That's not as nice,
since saving it is no longer a useful option.
--
Grant Edwards grant.b.edwards Yow! Now KEN and BARBIE
at are PERMANENTLY ADDICTED to
gmail.com MIND-ALTERING DRUGS ...
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: text to html Pedro Henrique Guedes Souto <pedro.h.souto@gmail.com> - 2011-12-13 15:30 -0200 Re: text to html Grant Edwards <invalid@invalid.invalid> - 2011-12-13 18:14 +0000 Re: text to html James Mills <prologic@shortcircuit.net.au> - 2011-12-14 05:54 -0800
csiph-web