lyx_mirror/lib/lyx2lyx
José Matos 58734edff6 Make the lyx2lyx code compatible between python2 and python3.
FWIW this code is important for very old versions of lyx, older than 1.1.5 (released 19 years ago - 2000/06/06).

Funny fact of the day, byte strings do not behave as regular strings in python3 when taking and index.
To get a sub-string we need to pass a range, a integer index will not work as it happens in a regular string:

$ ipython3
...
In [30]: line
Out[30]: b'#This file was created by <mike> Tue Jan 25 10:36:51 2000'

In [31]: line[0]
Out[31]: 35

In [32]: line[0:1]
Out[32]: b'#'

The range notations works for both byte and regular strings in python 3, and it also works in python 2.
Thus the change is simple and effective. In any case I should confess that I was quite surprised by this. :-)
2019-06-05 14:06:09 +01:00
..
.gitignore Setup .gitignore for generated files 2012-03-22 02:16:12 +01:00
CMakeLists.txt Cmake tests: Added parser_tools test to the lyx2lyx group tests 2014-06-12 09:07:57 +02:00
generate_encoding_info.py First step to make lyx2lyx code support both python 2 and python 3 (3.3+) 2015-03-11 12:09:18 +00:00
lyx2lyx Improve readability of the lyx2lyx help output. 2019-01-23 10:12:28 +01:00
lyx2lyx_lang.py
lyx2lyx_tools.py lyx2lyx refactoring and minor fixes. 2019-06-03 16:58:10 +02:00
lyx2lyx_version.py.in Fix inconsistent version in .lyx files (#7951) 2013-07-13 16:02:26 +02:00
lyx_0_06.py Update FSF address, patch from cornelisbb, #7735. 2011-08-25 23:10:36 +00:00
lyx_0_08.py Update FSF address, patch from cornelisbb, #7735. 2011-08-25 23:10:36 +00:00
lyx_0_10.py Small improvement to pre-historic file format conversion. 2018-04-28 14:57:57 +01:00
lyx_0_12.py In lib/lyx2lyx/: s/while 1/while True/ 2016-06-25 17:38:06 -04:00
lyx_1_0.py In lib/lyx2lyx/: s/while 1/while True/ 2016-06-25 17:38:06 -04:00
lyx_1_1_5.py In lib/lyx2lyx/: s/while 1/while True/ 2016-06-25 17:38:06 -04:00
lyx_1_1_6_0.py In lib/lyx2lyx/: s/while 1/while True/ 2016-06-25 17:38:06 -04:00
lyx_1_1_6_3.py In lib/lyx2lyx/: s/while 1/while True/ 2016-06-25 17:38:06 -04:00
lyx_1_1.py Update FSF address, patch from cornelisbb, #7735. 2011-08-25 23:10:36 +00:00
lyx_1_2.py In lib/lyx2lyx/: s/while 1/while True/ 2016-06-25 17:38:06 -04:00
lyx_1_3.py In lib/lyx2lyx/: s/while 1/while True/ 2016-06-25 17:38:06 -04:00
lyx_1_4.py Collapsable -> Collapsible (part 1) 2017-10-16 10:03:05 +02:00
lyx_1_5.py Add new semantic functions to add an remove document options. 2018-04-28 15:10:09 +01:00
lyx_1_6.py lyx2lyx refactoring. 2018-01-31 21:13:43 +01:00
lyx_2_0.py use revert_language in more cases 2019-03-10 13:00:10 +01:00
lyx_2_1.py use revert_language in more cases 2019-03-10 13:00:10 +01:00
lyx_2_2.py use revert_language in more cases 2019-03-10 13:00:10 +01:00
lyx_2_3.py lyx2lyx refactoring and minor fixes. 2019-06-03 16:58:10 +02:00
lyx_2_4.py Rework linguistic gloss support 2019-06-04 11:01:19 +02:00
LyX.py Make the lyx2lyx code compatible between python2 and python3. 2019-06-05 14:06:09 +01:00
Makefile.am Add literal param to InsetInclude 2018-02-23 08:58:16 +01:00
parser_tools.py lyx2lyx refactoring and minor fixes. 2019-06-03 16:58:10 +02:00
profiling.py Replace /usr/bin/env python -> /usr/bin/python3 2018-08-29 17:26:21 +01:00
test_lyx2lyx_tools.py lyx2lyx refactoring 2019-06-02 00:04:34 +02:00
test_parser_tools.py New lyx2lyx parser tools find_substring() and set_bool_value(). 2018-02-07 18:49:20 +01:00
unicode_symbols.py lyx2lyx refactoring. 2018-01-31 21:13:43 +01:00