Re: lyx2lyx or toc building is broken after user's guide update.
On Sunday 09 September 2007 17:15:28 Bo Peng wrote: One of the problems is the title Índice general LyX documentation can not be encoded at line 279 of LyX.py. This should be a unicode string. I changed all strings in that position to be unicode even although only the Spanish (for the moment) needs that distinction. In python a unicode string is a string that starts with an u. :-) Example: uOlá In python 3.0+ this distinction will disappear in the sense that all strings will be unicode. :-) I will commit the fix to trunk. Bo -- José Abílio
Re: lyx2lyx or toc building is broken after user's guide update.
On Sunday 09 September 2007 17:15:28 Bo Peng wrote: > One of the problems is the title "Índice general LyX documentation" > can not be encoded at line 279 of LyX.py. This should be a unicode string. I changed all strings in that position to be unicode even although only the Spanish (for the moment) needs that distinction. In python a unicode string is a string that starts with an u. :-) Example: u"Olá" In python 3.0+ this distinction will disappear in the sense that all strings will be unicode. :-) I will commit the fix to trunk. > Bo -- José Abílio
Re: lyx2lyx or toc building is broken after user's guide update.
It seems that doc_toc.py can no longer build toc. One of the problems is the title Índice general LyX documentation can not be encoded at line 279 of LyX.py. Bo
Re: lyx2lyx or toc building is broken after user's guide update.
Bo Peng schrieb: It seems that doc_toc.py can no longer build toc. One of the problems is the title Índice general LyX documentation can not be encoded at line 279 of LyX.py. This is strange because doc_toc.py is utf-8 encoded and the Í is included in latin1. But anyway, when I delete this character, I get: File D:\LyXSVN\lyx-devel\build-msvc\Resources\lyx2lyx\LyX.py, line 544, in get_toc while par[-1].strip() == '' and par: IndexError: list index out of range Unfortunately the LyX.py script doesn't contain code documentation so that I failed to find out what the par variable is and where it is set. It seems that the field size of info in doc_toc.py is hardcoded, but don't know why. Removing the new entry for Spanish in doc_toc.py doesn't help. José, can you help me here? regards Uwe
Re: lyx2lyx or toc building is broken after user's guide update.
This is strange because doc_toc.py is utf-8 encoded and the Í is included in latin1. But anyway, when I delete this character, I get: File D:\LyXSVN\lyx-devel\build-msvc\Resources\lyx2lyx\LyX.py, line 544, in get_toc while par[-1].strip() == '' and par: IndexError: list index out of range This line is logically wrong. It should be while par and par[-1].strip(): because whether or not par is empty should be tested before if the last line is empty. Bo
Re: lyx2lyx or toc building is broken after user's guide update.
Bo Peng schrieb: File D:\LyXSVN\lyx-devel\build-msvc\Resources\lyx2lyx\LyX.py, line 544, in get_toc while par[-1].strip() == '' and par: IndexError: list index out of range This line is logically wrong. It should be while par and par[-1].strip(): This fixes the list range bug, I therefore applied it. But the encoding problem remains: File D:\LyXSVN\lyx-devel\build-msvc\Resources\lyx2lyx\LyX.py, line 279, in write self.output.write(line.encode(self.encoding)+\n) UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 0: ordinal not in range(128) I thought that self.encoding uses the encoding of the file (that is utf-8 encoded). I removed the Í character for now from doc_toc.py so that you can compile in the meantime. thanks and regards Uwe
Re: lyx2lyx or toc building is broken after user's guide update.
File D:\LyXSVN\lyx-devel\build-msvc\Resources\lyx2lyx\LyX.py, line 544, in get_toc while par[-1].strip() == '' and par: IndexError: list index out of range This line is logically wrong. It should be while par and par[-1].strip(): This fixes the list range bug, I therefore applied it. Is it safe to apply it also to branch because I will have the same problem there when I add the Spanish UserGuide? regards Uwe
Re: lyx2lyx or toc building is broken after user's guide update.
This line is logically wrong. It should be while par and par[-1].strip(): This fixes the list range bug, I therefore applied it. I was not very careful, I meant 'and par[-1].strip() == '''. I have fixed it. Bo
Re: lyx2lyx or toc building is broken after user's guide update.
. I have fixed it. Ohmm, I have some network problem here and can not commit. Uwe, please fix it yourself. while par[-1].strip() == '' and par: to while par and par[-1].strip() == '': Cheers, Bo
Re: lyx2lyx or toc building is broken after user's guide update.
Bo Peng schrieb: I was not very careful, I meant 'and par[-1].strip() == '''. I have fixed it. I couldn't see this in SVN, so i fixed this there. thanks and regards Uwe
Re: lyx2lyx or toc building is broken after user's guide update.
> It seems that doc_toc.py can no longer > build toc. One of the problems is the title "Índice general LyX documentation" can not be encoded at line 279 of LyX.py. Bo
Re: lyx2lyx or toc building is broken after user's guide update.
Bo Peng schrieb: It seems that doc_toc.py can no longer build toc. One of the problems is the title "Índice general LyX documentation" can not be encoded at line 279 of LyX.py. This is strange because doc_toc.py is utf-8 encoded and the "Í" is included in latin1. But anyway, when I delete this character, I get: File "D:\LyXSVN\lyx-devel\build-msvc\Resources\lyx2lyx\LyX.py", line 544, in get_toc while par[-1].strip() == '' and par: IndexError: list index out of range Unfortunately the LyX.py script doesn't contain code documentation so that I failed to find out what the "par" variable is and where it is set. It seems that the field size of "info" in doc_toc.py is hardcoded, but don't know why. Removing the new entry for Spanish in doc_toc.py doesn't help. José, can you help me here? regards Uwe
Re: lyx2lyx or toc building is broken after user's guide update.
> This is strange because doc_toc.py is utf-8 encoded and the "Í" is included > in latin1. > But anyway, when I delete this character, I get: > > File "D:\LyXSVN\lyx-devel\build-msvc\Resources\lyx2lyx\LyX.py", line 544, in > get_toc > while par[-1].strip() == '' and par: > IndexError: list index out of range > This line is logically wrong. It should be while par and par[-1].strip(): because whether or not par is empty should be tested before if the last line is empty. Bo
Re: lyx2lyx or toc building is broken after user's guide update.
Bo Peng schrieb: File "D:\LyXSVN\lyx-devel\build-msvc\Resources\lyx2lyx\LyX.py", line 544, in get_toc while par[-1].strip() == '' and par: IndexError: list index out of range This line is logically wrong. It should be while par and par[-1].strip(): This fixes the list range bug, I therefore applied it. But the encoding problem remains: File "D:\LyXSVN\lyx-devel\build-msvc\Resources\lyx2lyx\LyX.py", line 279, in write self.output.write(line.encode(self.encoding)+"\n") UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 0: ordinal not in range(128) I thought that self.encoding uses the encoding of the file (that is utf-8 encoded). I removed the "Í" character for now from doc_toc.py so that you can compile in the meantime. thanks and regards Uwe
Re: lyx2lyx or toc building is broken after user's guide update.
File "D:\LyXSVN\lyx-devel\build-msvc\Resources\lyx2lyx\LyX.py", line 544, in get_toc while par[-1].strip() == '' and par: IndexError: list index out of range This line is logically wrong. It should be while par and par[-1].strip(): This fixes the list range bug, I therefore applied it. Is it safe to apply it also to branch because I will have the same problem there when I add the Spanish UserGuide? regards Uwe
Re: lyx2lyx or toc building is broken after user's guide update.
> > This line is logically wrong. It should be > > > > while par and par[-1].strip(): > > This fixes the list range bug, I therefore applied it. I was not very careful, I meant 'and par[-1].strip() == '''. I have fixed it. Bo
Re: lyx2lyx or toc building is broken after user's guide update.
>. I have fixed it. Ohmm, I have some network problem here and can not commit. Uwe, please fix it yourself. while par[-1].strip() == '' and par: to while par and par[-1].strip() == '': Cheers, Bo
Re: lyx2lyx or toc building is broken after user's guide update.
Bo Peng schrieb: I was not very careful, I meant 'and par[-1].strip() == '''. I have fixed it. I couldn't see this in SVN, so i fixed this there. thanks and regards Uwe