Re: python help needed

2008-07-09 Thread Jürgen Spitzmüller
rgheck wrote: > See if r25508 works for you. It does. Thanks indeed. Jürgen

Re: python help needed

2008-07-08 Thread rgheck
Juergen Spitzmueller wrote: rgheck wrote: I finally got around to doing this. I've also re-written the latex2lyx conversion routine so that it uses the unicodesymbols file. I'm not sure exactly what you had in mind for convert_subfig, as I don't know anything about figures, but perhaps this

Re: python help needed

2008-07-08 Thread Juergen Spitzmueller
rgheck wrote: > I finally got around to doing this. I've also re-written the latex2lyx > conversion routine so that it uses the unicodesymbols file. > > I'm not sure exactly what you had in mind for convert_subfig, as I don't > know anything about figures, but perhaps this will let you do it now?

Re: python help needed

2008-07-07 Thread rgheck
Jürgen Spitzmüller wrote: In order to fully fix bug 4927, we need to do some LaTeX->LyX conversion, because subfigure captions can contain LaTeX constructs such as \label. Currently, subcaptions with such constructs are simply eaten (i.e., dataloss). I think we should factor out the routines of

Re: python help needed

2008-06-08 Thread Jürgen Spitzmüller
José Matos wrote: > > I'm happy to do this, but it'll be a bit, as I "have" to go to St > > Andrews next week and will be busy. > > I am more or less on the same situation. Really busy here with several > deadlines and at the same time glad to help you after the next week. :-) Thank you both. I'll

Re: python help needed

2008-06-06 Thread José Matos
On Friday 06 June 2008 17:13:17 rgheck wrote: > I'm happy to do this, but it'll be a bit, as I "have" to go to St > Andrews next week and will be busy. I am more or less on the same situation. Really busy here with several deadlines and at the same time glad to help you after the next week. :-)

Re: python help needed

2008-06-06 Thread rgheck
Juergen Spitzmueller wrote: In order to fully fix bug 4927, we need to do some LaTeX->LyX conversion, because subfigure captions can contain LaTeX constructs such as \label. Currently, subcaptions with such constructs are simply eaten (i.e., dataloss). I think we should factor out the routines o

Re: python help needed

2007-01-13 Thread Georg Baum
Am Mittwoch, 10. Januar 2007 23:18 schrieb José Matos: > On Wednesday 10 January 2007 9:33 pm, Georg Baum wrote: > > Ah, now I know the problem: If we add string literals to document.body we > > need to prefix them with u to get unicode string literals: u'bla'. Now I > > know where to search. >

Re: python help needed

2007-01-10 Thread José Matos
On Wednesday 10 January 2007 9:33 pm, Georg Baum wrote: > Ah, now I know the problem: If we add string literals to document.body we > need to prefix them with u to get unicode string literals: u'bla'. Now I > know where to search. That is enough to drive anyone (read me) crazy. :-) > Georg --

Re: python help needed

2007-01-10 Thread Georg Baum
Am Mittwoch, 10. Januar 2007 01:00 schrieb Enrico Forestieri: > No, the problem is that something is messed up. Apparently, > document.body[i] may already be in unicode format. Yes, that is done in LyX.py. > See for example: > http://www.red-mercury.com/blog/eclectic-tech/python-mystery-of-the-d

Re: python help needed

2007-01-09 Thread Enrico Forestieri
On Tue, Jan 09, 2007 at 11:28:04PM +0100, Enrico Forestieri wrote: > On Tue, Jan 09, 2007 at 11:23:52PM +0100, Enrico Forestieri wrote: > > On Tue, Jan 09, 2007 at 10:25:15PM +0100, Georg Baum wrote: > > > Am Dienstag, 9. Januar 2007 22:19 schrieb Enrico Forestieri: > > > > > > > No, I didn't try

Re: python help needed

2007-01-09 Thread José Matos
On Tuesday 09 January 2007 6:46 pm, Georg Baum wrote: > José or any other python expert, I need your help. The attached patch is > the lyx2lyx part of the "getting rid of InsetLaTeXAccent" patch. > convert_accent works well, but revert_accent does not. I put the error > messages in the file. Can an

Re: python help needed

2007-01-09 Thread Enrico Forestieri
On Tue, Jan 09, 2007 at 11:23:52PM +0100, Enrico Forestieri wrote: > On Tue, Jan 09, 2007 at 10:25:15PM +0100, Georg Baum wrote: > > Am Dienstag, 9. Januar 2007 22:19 schrieb Enrico Forestieri: > > > > > No, I didn't try your patch. > > > > That does not help :-( Your script works for me, too. Th

Re: python help needed

2007-01-09 Thread Enrico Forestieri
On Tue, Jan 09, 2007 at 10:25:15PM +0100, Georg Baum wrote: > Am Dienstag, 9. Januar 2007 22:19 schrieb Enrico Forestieri: > > > No, I didn't try your patch. > > That does not help :-( Your script works for me, too. The strange thing is > that the type of document.body[i] is neither a normal str

Re: python help needed

2007-01-09 Thread Georg Baum
Am Dienstag, 9. Januar 2007 22:19 schrieb Enrico Forestieri: > No, I didn't try your patch. That does not help :-( Your script works for me, too. The strange thing is that the type of document.body[i] is neither a normal string nor a unicode string. At least the error messages seem to suggest t

Re: python help needed

2007-01-09 Thread Enrico Forestieri
On Tue, Jan 09, 2007 at 09:57:12PM +0100, Georg Baum wrote: > Am Dienstag, 9. Januar 2007 21:42 schrieb Enrico Forestieri: > > On Tue, Jan 09, 2007 at 07:46:47PM +0100, Georg Baum wrote: > > > José or any other python expert, I need your help. The attached patch > is > > > the lyx2lyx part of the

Re: python help needed

2007-01-09 Thread Georg Baum
Am Dienstag, 9. Januar 2007 21:42 schrieb Enrico Forestieri: > On Tue, Jan 09, 2007 at 07:46:47PM +0100, Georg Baum wrote: > > José or any other python expert, I need your help. The attached patch is > > the lyx2lyx part of the "getting rid of InsetLaTeXAccent" patch. > > convert_accent works we

Re: python help needed

2007-01-09 Thread Enrico Forestieri
On Tue, Jan 09, 2007 at 07:46:47PM +0100, Georg Baum wrote: > José or any other python expert, I need your help. The attached patch is > the lyx2lyx part of the "getting rid of InsetLaTeXAccent" patch. > convert_accent works well, but revert_accent does not. I put the error > messages in the fil

Re: python help needed for bug in lyxpreview2ppm.py

2005-12-07 Thread Angus Leeming
Angus Leeming wrote: > That is indeed a problem. We can't quote the first word. > > I think that the thing to do here is to split the full path to the > executable into "basename" and "dirname" parts, to add the "dirname" to > the PATH environment variable (if it's not there already) and to execut

Re: python help needed for bug in lyxpreview2ppm.py

2005-12-07 Thread Angus Leeming
On Wednesday 07 December 2005 23:20, Uwe Stöhr wrote: > I investigated a bit and the problem seems to be the call of gs itself: > > The blabla.ps generated by Instant preview can be in a path with spaces > and will work as long as the gswin32c.exe isn't in a path with spaces. > > So it seems that g

Re: python help needed for bug in lyxpreview2ppm.py

2005-12-07 Thread Uwe Stöhr
Angus Leeming wrote: I either don't understand python nor do I know who wrote the lyxpreview2ppm.py-script. Then perhaps you should read line 8 of this script? Oh how embarrassing. Maybe I'm blind but everything appears to be quoted correctly to me. The lines below generate a string, gs_ca

Re: python help needed for bug in lyxpreview2ppm.py

2005-12-07 Thread Angus Leeming
On Wednesday 07 December 2005 22:52, you wrote: > Hello developers, > > I just realized a bug in lyxpreview2ppm-py that prevents a working > Instant preview when LyX is installed in a path with spces. > > The problem ist the following: > > When LyX is installed in e.g. C:\Program Files\LyX Ghostscr

Re: Python help needed ;-)

2003-06-04 Thread Angus Leeming
Jose' Matos wrote: > On Wednesday 04 June 2003 13:45, Angus Leeming wrote: >> >> Not quite. If the second ExternalInset is of Template "Date" (no >> filename) then the result is >> \begin_inset External >> template Date >> filename taulogo.png >> >> where taulogo.png is filename fr

Re: Python help needed ;-)

2003-06-04 Thread Jose' Matos
On Wednesday 04 June 2003 13:45, Angus Leeming wrote: > > Not quite. If the second ExternalInset is of Template "Date" (no filename) > then the result is > \begin_inset External > template Date > filename taulogo.png > > where taulogo.png is filename from the first ExternalInset. >

Re: Python help needed ;-)

2003-06-04 Thread Angus Leeming
Jose' Matos wrote: > On Wednesday 04 June 2003 13:29, Angus Leeming wrote: >> [snip...] >> >> Thanks José. Thanks Dekel. >> >> I amalgamated your suggestions. Attached. >> >> It works fine, but I have a couple of (three) questions: > > def convert_external(lines): > external_rexp = re.compile

Re: Python help needed ;-)

2003-06-04 Thread Jose' Matos
On Wednesday 04 June 2003 13:29, Angus Leeming wrote: > [snip...] > > Thanks José. Thanks Dekel. > > I amalgamated your suggestions. Attached. > > It works fine, but I have a couple of (three) questions: def convert_external(lines): external_rexp = re.compile(r'\\begin_inset External (.*),"(.*

Re: Python help needed ;-)

2003-06-04 Thread Angus Leeming
Jose' Matos wrote: >> Could someone write the 5 lines of code? Plase? > > def convert_external(lines): [snip...] Thanks José. Thanks Dekel. I amalgamated your suggestions. Attached. It works fine, but I have a couple of (three) questions: 1. Can I add the header variable into the expressio

Re: Python help needed ;-)

2003-06-04 Thread Dekel Tsur
On Wed, Jun 04, 2003 at 11:18:09AM +0100, Jose' Matos wrote: > > I point the answer, use split. > > > Could someone write the 5 lines of code? Plase? > > def convert_external(lines): > i = 0 > while 1: > i = find_token(lines, "\\begin_inset External", i) > if i == -

Re: Python help needed ;-)

2003-06-04 Thread Jose' Matos
On Wednesday 04 June 2003 11:33, Angus Leeming wrote: > I want to add a module to lyxconvert_221.py to change this: > > \begin_inset External RasterImage,"taulogo.png","" > > \end_inset > > to this > > \begin_inset External > template RasterImage > filename taulogo.png > > \end_inse

Re: Python help needed ;-)

2003-06-04 Thread Dekel Tsur
On Wed, Jun 04, 2003 at 10:33:02AM +, Angus Leeming wrote: > I want to add a module to lyxconvert_221.py to change this: > > \begin_inset External RasterImage,"taulogo.png","" > > \end_inset > > to this > > \begin_inset External > template RasterImage > filename taulogo.png

Re: Python help needed ;-)

2003-06-04 Thread Andre Poenitz
On Wed, Jun 04, 2003 at 10:33:02AM +, Angus Leeming wrote: > throwing away the final arg (here "", more generally "") that holds > the parameters variable. I guess that we could retain the filename within > quotes as LyXLeX will handle that. We should, as this may contain spaces, shouldn't w