Commit Graph

7 Commits

Author SHA1 Message Date
Julien Rioux
0fb13b648c * prefs2prefs.py : Use a list of [format, conversions] pair.
Use a list of [int, list of functions] pair, representing
      - int: the format number, and
      - list of functions: what needs to be done to the file to
                           update it to the given format number.

    This matches what is done in lyx2lyx and helps keeping track of
    format numbers and their corresponding conversion routines.

    Also, add another sanity check.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39668 a592a061-630c-0410-9148-cb99ea01b6c8
2011-09-12 20:43:06 +00:00
Julien Rioux
ba02c43178 * prefs2prefs.py : Error when both -l and -p are given, update usage.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39667 a592a061-630c-0410-9148-cb99ea01b6c8
2011-09-12 20:42:53 +00:00
Julien Rioux
603be7fe2f * prefs2prefs.py : Don't choke on empty input file.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39666 a592a061-630c-0410-9148-cb99ea01b6c8
2011-09-12 20:42:40 +00:00
Richard Heck
7e7f98532d Silly typos. Thanks, Stephan.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37256 a592a061-630c-0410-9148-cb99ea01b6c8
2011-01-18 23:11:27 +00:00
Richard Heck
054dfe3c00 Improve the prefs2prefs scripts a bit.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37250 a592a061-630c-0410-9148-cb99ea01b6c8
2011-01-18 15:37:20 +00:00
Richard Heck
f97bc9b9e7 A little more work on prefs2prefs.
More to come, Pavel!



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37225 a592a061-630c-0410-9148-cb99ea01b6c8
2011-01-16 03:59:43 +00:00
Richard Heck
851d01721f A go at creating a prefs2prefs framework. There's a main file, prefs2prefs.py, and two subsidiary files,
prefs2prefs_lfuns.py and prefs2prefs_prefs.py. I've organized it this way because, in many ways, these are
 the same task. It's very line-by-line, unlike lyx2lyx and layout2layout, where things can be more "global". 
So we read the file, line by line, and give a bunch of converter functions a chance to see if they want to 
modify that line.

The converter functions are all in the subsidiary files. (Only the lfun one has anything in it now.) They 
take a line as argument and return a list: (Bool, NewLine), where the Bool says if we've modified anything 
and the NewLine is the new line, if so.

The format of the existing files is format 0, and we'll introduce new format numbers as we proceed, 
just as with layout2layout. So the conversion from format 0 to format 1 will be huge; others will 
generally be simple.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35426 a592a061-630c-0410-9148-cb99ea01b6c8
2010-09-17 14:44:38 +00:00