logo       

Re: [viewvc-users] php highlighting: msg#00044

Subject: Re: [viewvc-users] php highlighting
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




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
audio.irate.dev...    yellowdog.gener...    ietf.ips/2002-0...    xfree86.fonts/2...    busybox/2003-07...    emacs.jdee/2004...    linux.mandrake....    hardware.microc...    user-groups.lin...    science.analysi...    version-control...    db.filemaker.de...    cluster.openmos...    mail.eyebrowse....    text.xml.xerces...    kde.devel.kwrit...    finance.moneyda...    gcc.regression/...    network.routing...    os.freebsd.deve...    recreation.radi...    qnx.openqnx.dev...    python.xml/2002...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe