python tutorial required

2003-02-05 Thread Angus Leeming
I read this as saying that a Formula inset in a lyx file in lyxformat 216 should not contain any line breaks. Correct? def merge_formula_inset(lines): i=0 while 1: i = find_token(lines, \\begin_inset Formula, i) if i == -1: break if lines[i+1] in math_env:

Re: python tutorial required

2003-02-05 Thread José Matos
On Wednesday 05 February 2003 13:53, Angus Leeming wrote: I read this as saying that a Formula inset in a lyx file in lyxformat 216 should not contain any line breaks. Correct? Yes. Although this looks sloppy code, the idea is to be able to user older python versions. If I could use python

Re: python tutorial required

2003-02-05 Thread Angus Leeming
José Matos wrote: On Wednesday 05 February 2003 13:53, Angus Leeming wrote: I read this as saying that a Formula inset in a lyx file in lyxformat 216 should not contain any line breaks. Correct? Yes. Although this looks sloppy code, the idea is to be able to user older python

Re: python tutorial required

2003-02-05 Thread Andre Poenitz
On Wed, Feb 05, 2003 at 01:53:05PM +, Angus Leeming wrote: I read this as saying that a Formula inset in a lyx file in lyxformat 216 should not contain any line breaks. Correct? def merge_formula_inset(lines): i=0 while 1: i = find_token(lines, \\begin_inset Formula,

Re: python tutorial required

2003-02-05 Thread Jos Matos
On Wednesday 05 February 2003 15:15, Angus Leeming wrote: def merge_formula_inset(lines): i=0 while 1: i = find_token(lines, \\begin_inset Formula, i) if i == -1: break if lines[i+1] in math_env: lines[i] = lines[i] + lines[i+1]

Re: python tutorial required

2003-02-05 Thread José Matos
On Wednesday 05 February 2003 15:24, Andre Poenitz wrote: I read it like that as well, but this is no math parser restriction as far as I know. The file is well read with present lyx, but I tried as much as I could to make a null diff between two consecutives writes of the documents. That

Re: python tutorial required

2003-02-05 Thread Andre Poenitz
On Wed, Feb 05, 2003 at 03:47:41PM +, José Matos wrote: On Wednesday 05 February 2003 15:24, Andre Poenitz wrote: I read it like that as well, but this is no math parser restriction as far as I know. The file is well read with present lyx, but I tried as much as I could to make a

Re: python tutorial required

2003-02-05 Thread Angus Leeming
José Matos wrote: On Wednesday 05 February 2003 15:15, Angus Leeming wrote: def merge_formula_inset(lines): i=0 while 1: i = find_token(lines, \\begin_inset Formula, i) if i == -1: break if lines[i+1] in math_env: lines[i] = lines[i] +

Re: python tutorial required

2003-02-05 Thread Jos Matos
On Wednesday 05 February 2003 16:07, Angus Leeming wrote: $ cat test_215.lyx | sed 's/\(.\)$/\1X/' On linux I use cat -E for it, although I could use cat -e and be portable (since you care ;-). So, I guess you don't need to do anything and nor do I in this case either. That is what I

Re: python tutorial required

2003-02-05 Thread Angus Leeming
José Matos wrote: On Wednesday 05 February 2003 16:07, Angus Leeming wrote: $ cat test_215.lyx | sed 's/\(.\)$/\1X/' On linux I use cat -E for it, although I could use cat -e and be portable (since you care ;-). chuckle. more a case of don't know better. -- Angus

python tutorial required

2003-02-05 Thread Angus Leeming
I read this as saying that a Formula inset in a lyx file in lyxformat 216 should not contain any line breaks. Correct? def merge_formula_inset(lines): i=0 while 1: i = find_token(lines, "\\begin_inset Formula", i) if i == -1: break if lines[i+1] in math_env:

Re: python tutorial required

2003-02-05 Thread José Matos
On Wednesday 05 February 2003 13:53, Angus Leeming wrote: > I read this as saying that a Formula inset in a lyx file in lyxformat 216 > should not contain any line breaks. Correct? Yes. Although this looks sloppy code, the idea is to be able to user older python versions. If I could use

Re: python tutorial required

2003-02-05 Thread Angus Leeming
José Matos wrote: > On Wednesday 05 February 2003 13:53, Angus Leeming wrote: >> I read this as saying that a Formula inset in a lyx file in lyxformat 216 >> should not contain any line breaks. Correct? > > Yes. > Although this looks sloppy code, the idea is to be able to user older >

Re: python tutorial required

2003-02-05 Thread Andre Poenitz
On Wed, Feb 05, 2003 at 01:53:05PM +, Angus Leeming wrote: > I read this as saying that a Formula inset in a lyx file in lyxformat 216 > should not contain any line breaks. Correct? > > def merge_formula_inset(lines): > i=0 > while 1: > i = find_token(lines, "\\begin_inset

Re: python tutorial required

2003-02-05 Thread José Matos
On Wednesday 05 February 2003 15:15, Angus Leeming wrote: > >> def merge_formula_inset(lines): > >> i=0 > >> while 1: > >> i = find_token(lines, "\\begin_inset Formula", i) > >> if i == -1: break > >> if lines[i+1] in math_env: > >> lines[i] = lines[i] +

Re: python tutorial required

2003-02-05 Thread José Matos
On Wednesday 05 February 2003 15:24, Andre Poenitz wrote: > I read it like that as well, but this is no math parser restriction > as far as I know. The file is well read with present lyx, but I tried as much as I could to make a null diff between two consecutives writes of the documents. That

Re: python tutorial required

2003-02-05 Thread Andre Poenitz
On Wed, Feb 05, 2003 at 03:47:41PM +, José Matos wrote: > On Wednesday 05 February 2003 15:24, Andre Poenitz wrote: > > I read it like that as well, but this is no math parser restriction > > as far as I know. > > The file is well read with present lyx, but I tried as much as I could to >

Re: python tutorial required

2003-02-05 Thread Angus Leeming
José Matos wrote: > On Wednesday 05 February 2003 15:15, Angus Leeming wrote: >> >> def merge_formula_inset(lines): >> >> i=0 >> >> while 1: >> >> i = find_token(lines, "\\begin_inset Formula", i) >> >> if i == -1: break >> >> if lines[i+1] in math_env: >> >>

Re: python tutorial required

2003-02-05 Thread José Matos
On Wednesday 05 February 2003 16:07, Angus Leeming wrote: > $ cat test_215.lyx | sed 's/\(.\)$/\1X/' On linux I use cat -E for it, although I could use cat -e and be portable (since you care ;-). > So, I guess you don't need to do anything and nor do I in this case either. That is what I

Re: python tutorial required

2003-02-05 Thread Angus Leeming
José Matos wrote: > On Wednesday 05 February 2003 16:07, Angus Leeming wrote: >> $ cat test_215.lyx | sed 's/\(.\)$/\1X/' > > On linux I use cat -E for it, although I could use cat -e and be > portable > (since you care ;-). chuckle. more a case of don't know better. -- Angus