endheaders().
Also, not that easy. python is OO and you gotta import the class and
create and instance and what-not. I suck at python so I don't know
where to begin really :).
Hopefully a viewvc dev will take pity on us. The feature is broken.
On 9/20/06, Brian G. Peterson <brian@xxxxxxxxxxxxx> wrote:
On Wednesday 20 September 2006 13:14, Brian G. Peterson wrote:
> On 9/20/06, Brian G. Peterson <brian@xxxxxxxxxxxxx> wrote:
> > On Wednesday 20 September 2006 11:55, Mark wrote:
> > > Since using cli php for highlighting doesn't work becaus of
> > > force-cgi-redirect, I decided to try to use the highlight_string()
> > > builtin. I changed markup_stream_php to this but it does not
> > > output the file at all when used. what am I doing wrong? I suck
> > > at python, btw :)
> > >
> > > def markup_stream_php(fp, cfg):
> > > if not cfg.options.use_php:
> > > return None
> > >
> > > sys.stdout.flush()
> > >
> > > html = cgi.escape(fp.read())
> > > html = '<?php highlight_string(\'' + html
> > > html += '\'); ?>'
> > > return html
> >
> > I solved this problem once before, two different ways.
> >
> > You can see the thread here:
> > http://archive.netbsd.se/index.php?ml=viewcvs&a=2003-05&t=404190
> >
> > I hope that the project's new management will take notice and get a
> > working fix into the core of ViewVC.
>
> On Wednesday 20 September 2006 12:50, Mark wrote:
> > I tried that actually, and it did not work. I get this error in my
> > apache log; [Wed Sep 20 10:48:34 2006] [error] [client 170.1.20.17]
> > malformed header from script. Bad header=<code><font
> > color="#000000">: viewvc.cgi, referer:
> > http://my.url.com/viewvc/blah/blah
> >
> > I'm using viewvc-1.0.1. Looks like maybe I don't get a proper header
> > before the highlighted code hits the browser?
>
> My function, file, and patch were against ViewCVS 0.9.2, so I'm not
> surprised that they don't work w/ current code.
>
> Maybe a project dev will take pity on us and update my patch?
> I suppose you could just add a header() fn call to my script, or figure
> out how to send headers in python.
On Wednesday 20 September 2006 15:27, Mark wrote:
> that didn't help either :(
The python formulation would be something like this:
headers = {"Content-type": "text/html; charset=iso-8859-1"}
endheaders{}
NOTE: I haven't tested this, but it should be possible to force headers in
this way before sending the html output from my script.
Regards,
- Brian
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxxx
--
Mark
"Blessed is he who finds happiness in his own foolishness, for he will
always be happy."
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxxx
|