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-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 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-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

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

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

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-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-09 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 wait

Re: python help needed

2008-06-09 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.

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

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. :-) rh

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

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. :-)

python help needed

2008-06-05 Thread Juergen Spitzmueller
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 convert_latexcommand_index

python help needed

2008-06-05 Thread Juergen Spitzmueller
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 convert_latexcommand_index

Re: Result of: Python help needed for configure.py - MiKTeX-problem

2007-01-15 Thread Jean-Marc Lasgouttes
Bo == Bo Peng [EMAIL PROTECTED] writes: When the check is unsuccessful the line becomes invalid and therefore the while loop breaks. The problem of this is line 77 in chkconfig.ltx (command definition of \TestItem) : Bo I did not like chkconfig.ltx but was not able to replace it. Bo

Re: Result of: Python help needed for configure.py - MiKTeX-problem

2007-01-15 Thread Jean-Marc Lasgouttes
Uwe == Uwe Stöhr [EMAIL PROTECTED] writes: Uwe When MiKTeX's option Install Missing Packages on the fly is set Uwe as Yes but no Internet connection is open when \ifFileExists is Uwe invoked, the latex-script is closed by MiKTeX and you get in the Uwe console: Uwe latex: No Data Uwe I wrote an

Re: Result of: Python help needed for configure.py - MiKTeX-problem

2007-01-15 Thread Uwe Stöhr
Jean-Marc Lasgouttes schrieb: Uwe I wrote an email to the MiKTeX-developer but I don't have hope Uwe that this could easily be fixed :-(. This is pretty bad indeed. Does latex return an error code in this case? No, nothing. He could confirm the bug, but I don't know what he plan to fix

Re: Result of: Python help needed for configure.py - MiKTeX-problem

2007-01-15 Thread Jean-Marc Lasgouttes
> "Bo" == Bo Peng <[EMAIL PROTECTED]> writes: >> When the check is unsuccessful the line becomes invalid and >> therefore the while loop breaks. The problem of this is line 77 in >> chkconfig.ltx (command definition of \TestItem) : Bo> I did not like chkconfig.ltx but was not able to replace

Re: Result of: Python help needed for configure.py - MiKTeX-problem

2007-01-15 Thread Jean-Marc Lasgouttes
> "Uwe" == Uwe Stöhr <[EMAIL PROTECTED]> writes: Uwe> When MiKTeX's option "Install Missing Packages on the fly" is set Uwe> as "Yes" but no Internet connection is open when \ifFileExists is Uwe> invoked, the latex-script is closed by MiKTeX and you get in the Uwe> console: Uwe> latex: No

Re: Result of: Python help needed for configure.py - MiKTeX-problem

2007-01-15 Thread Uwe Stöhr
Jean-Marc Lasgouttes schrieb: Uwe> I wrote an email to the MiKTeX-developer but I don't have hope Uwe> that this could easily be fixed :-(. This is pretty bad indeed. Does latex return an error code in this case? No, nothing. He could confirm the bug, but I don't know what he plan to fix

Re: Result of: Python help needed for configure.py - MiKTeX-problem

2007-01-13 Thread Uwe Stöhr
Bo Peng schrieb: The problem of this is line 77 in chkconfig.ltx (command definition of \TestItem) : I did not like chkconfig.ltx but was not able to replace it. chkconfig.ltx uses latex to check latex packages and generate a result file. It would be slower and cleaner to test each package

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. That

Re: Result of: Python help needed for configure.py - MiKTeX-problem

2007-01-13 Thread Uwe Stöhr
Bo Peng schrieb: The problem of this is line 77 in chkconfig.ltx (command definition of \TestItem) : I did not like chkconfig.ltx but was not able to replace it. chkconfig.ltx uses latex to check latex packages and generate a result file. It would be slower and cleaner to test each package

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. >

Result of: Python help needed for configure.py - MiKTeX-problem

2007-01-12 Thread Uwe Stöhr
+checking for package geometry [geometry]... yes +checking for package jurabib [jurabib]... creating packages.lst creating doc/LaTeXConfig.lyx LyX: Fertig! lyx: Disabling LyX socket. And this is the problem: In the example above configure.py checks for the LaTeX-package jurabib and MiKTeX tries

Re: Result of: Python help needed for configure.py - MiKTeX-problem

2007-01-12 Thread Bo Peng
When the check is unsuccessful the line becomes invalid and therefore the while loop breaks. The problem of this is line 77 in chkconfig.ltx (command definition of \TestItem) : I did not like chkconfig.ltx but was not able to replace it. chkconfig.ltx uses latex to check latex packages and

Result of: Python help needed for configure.py - MiKTeX-problem

2007-01-12 Thread Uwe Stöhr
+checking for package geometry [geometry]... yes +checking for package jurabib [jurabib]... creating packages.lst creating doc/LaTeXConfig.lyx LyX: Fertig! lyx: Disabling LyX socket. And this is the problem: In the example above configure.py checks for the LaTeX-package jurabib and MiKTeX tries

Re: Result of: Python help needed for configure.py - MiKTeX-problem

2007-01-12 Thread Bo Peng
When the check is unsuccessful the line becomes invalid and therefore the while loop breaks. The problem of this is line 77 in chkconfig.ltx (command definition of \TestItem) : I did not like chkconfig.ltx but was not able to replace it. chkconfig.ltx uses latex to check latex packages and

Python help needed for configure.py

2007-01-11 Thread Uwe Stöhr
Hi Bo and all others who know Phyton: I have a big problem here with my win builds due to the following problem of configure.py: MiKTeX's option Instal missing packages on the fly the nice feature that will automatically install LaTeX-packages LyX is checking in configure.py is set to Yes. Now

Python help needed for configure.py

2007-01-11 Thread Uwe Stöhr
Hi Bo and all others who know Phyton: I have a big problem here with my win builds due to the following problem of configure.py: MiKTeX's option "Instal missing packages on the fly" the nice feature that will automatically install LaTeX-packages LyX is checking in configure.py is set to "Yes".

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 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 --

python help needed

2007-01-09 Thread Georg Baum
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 anybody tell me why document.body[i] =

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 file.

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 well, but

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 getting

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

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 string

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. The strange

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 anybody

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 your patch.

python help needed

2007-01-09 Thread Georg Baum
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 anybody tell me why document.body[i] =

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

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

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

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

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

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.

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

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

python help needed for bug in lyxpreview2ppm.py

2005-12-07 Thread Uwe Stöhr
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 Ghostscript is called by lyxpreview2ppm as gswin32c.exe C:\Program

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 Ghostscript is

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,

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 gs is

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 execute the

python help needed for bug in lyxpreview2ppm.py

2005-12-07 Thread Uwe Stöhr
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 Ghostscript is called by lyxpreview2ppm as gswin32c.exe C:\Program

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

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,

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

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

Python help needed ;-)

2003-06-04 Thread Angus Leeming
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_inset throwing away the final arg (here , more generally string) that holds

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 string) 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

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 \end_inset

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_inset throwing

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 == -1:

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 expression

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: 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

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. Is there

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 from the first

Python help needed ;-)

2003-06-04 Thread Angus Leeming
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_inset throwing away the final arg (here "", more generally "") that holds

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

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

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 > >

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 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

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: > 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: 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: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