From 5924500e2453d9467372d3cfe9cbc6398b311695 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Matox?= Date: Wed, 25 Apr 2007 16:14:59 +0000 Subject: [PATCH] Update file format, textclass cv -> simplecv git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17993 a592a061-630c-0410-9148-cb99ea01b6c8 --- development/FORMAT | 51 +++++++++++++++++++++++------------------- lib/lyx2lyx/LyX.py | 10 +++++++-- lib/lyx2lyx/lyx_1_5.py | 17 ++++++++++++-- src/buffer.C | 2 +- 4 files changed, 52 insertions(+), 28 deletions(-) diff --git a/development/FORMAT b/development/FORMAT index 9e4284805f..fbba433b8d 100644 --- a/development/FORMAT +++ b/development/FORMAT @@ -1,6 +1,11 @@ LyX file-format changes ------------------------§ -2007-02-22 José Matos +----------------------- +2007-04-24 José Matos + + * format incremented to 264: + textclass cv is renamed simplecv + +2007-02-22 José Matos * format incremented to 263: changes in the language names (overdue): brazil -> brazilian @@ -40,7 +45,7 @@ LyX file-format changes 'xx \textbf{yy} zz'. New: Spaces are always output with the font set by the user. -2007-01-31 Uwe Stöhr +2007-01-31 Uwe Stöhr * format incremented to 258: new \lyxline definition Old: @@ -117,7 +122,7 @@ LyX file-format changes The order of the parameters and for each parameter the name and optional/required bit is now stored in InsetCommandParams. -2006-10-03 Jürgen Spitzmüller +2006-10-03 Jürgen Spitzmüller * format incremented to 251: save show_label param for charstyles. @@ -164,7 +169,7 @@ LyX file-format changes topspace, bottomspace and interlinespace. All take a LyXLength as value, or the special keyword "default". -2006-06-10 Jürgen Spitzmüller +2006-06-10 Jürgen Spitzmüller * format incremented to 247. The Grand Font Interface Rewrite. (1) Split font selection to rm, sf, tt: @@ -207,19 +212,19 @@ LyX file-format changes * format incremented to 246. The framed.sty package is now supported with note types framed and shaded. -2005-10-12 Jürgen Spitzmüller +2005-10-12 Jürgen Spitzmüller * format incremented to 245. The \quotes_times parameter has been removed. -2005-09-24 Jürgen Spitzmüller +2005-09-24 Jürgen Spitzmüller * format incremented to 244. Rename '\InsetSpace \,' to '\InsetSpace \thinspace{}', because the comma was not parsed by lyxlex, and '\InsetSpace \space' to '\InsetSpace \space{}' in favour of consistency. -2005-07-18 José Matos +2005-07-18 José Matos * format incremented to 243. @@ -247,7 +252,7 @@ LyX file-format changes latex output, but now they can't be read or set anymore (bug 922). -2005-01-23 Jürgen Spitzmüller +2005-01-23 Jürgen Spitzmüller * format incremented to 240. * new bufferparam: @@ -255,7 +260,7 @@ LyX file-format changes (should the change tracking marks be visible in the output or not?) * lyx2lyx should just delete the param in 239. -2005-01-06 José Matos +2005-01-06 José Matos * format incremented to 239. * the paragraph parameters are displayed in their own line. This @@ -272,7 +277,7 @@ Paragraph text. \end_layout -2004-12-03 José Matos +2004-12-03 José Matos * format incremented to 238. * The compatibility code to read old latex accents from 0.12.x in @@ -289,7 +294,7 @@ Paragraph text. so formats 215 - 237 can have both versions. -2004-10-10 José Matos +2004-10-10 José Matos * format incremented to 237. * In the header, the following statments use now booleans values, @@ -298,7 +303,7 @@ Paragraph text. - \use_bibtopic - \tracking_changes -2004-08-15 José Matos +2004-08-15 José Matos * format incremented to 236. * Added tags: @@ -343,7 +348,7 @@ Paragraph text. * insetgraphics does not allow filenames without extension anymore. The complete filename has to be given. -2004-03-29 Jürgen Spitzmüller +2004-03-29 Jürgen Spitzmüller * format incremented to 232. @@ -363,7 +368,7 @@ Paragraph text. \end{btSect} has to be inserted. -2004-03-29 Jürgen Spitzmüller +2004-03-29 Jürgen Spitzmüller * format incremented to 231. @@ -376,7 +381,7 @@ Paragraph text. \begin{sidewaystable} \end{sidewaystable} i.e. ERT. -2004-02-23 Jürgen Spitzmüller +2004-02-23 Jürgen Spitzmüller * format incremented to 230. @@ -392,7 +397,7 @@ Paragraph text. (jurabib fails if babel is called afterwards). If the natbib commands are used together with jurabib, they have to be converted to ERT too. -2003-12-29 Jürgen Spitzmüller +2003-12-29 Jürgen Spitzmüller * format incremented to 229. * Minipages cannot be read anymore. All minipage insets will @@ -434,7 +439,7 @@ Paragraph text. \begin_inset Comment -> \begin_inset Note Comment \begin_inset Greyedout -> \begin_inset Note Greyedout -2003-11-28 André Pönitz +2003-11-28 André Pönitz * Remove space_above/space_below from Paragraph. This is now handled by InsetVSpace. @@ -522,15 +527,15 @@ Paragraph text. \end_inset -2003-07-28 José Matos +2003-07-28 José Matos * \the_end is replaced with \end_document -2003-07-28 José Matos +2003-07-28 José Matos * \layout is replaced with \begin_layout -2003-07-28 José Matos +2003-07-28 José Matos Format bumped to 225 @@ -564,14 +569,14 @@ Paragraph text. Moreover, the RasterImage template has been scrapped. All RasterImage external insets are now converted to Graphics insets. -2003-05-20 Jürgen Spitzmüller +2003-05-20 Jürgen Spitzmüller * Added new space insets: \SpecialChar ~ is now \InsetSpace ~ ERT: "\ " could be converted to InsetSpace \ ERT: "\," could be converted to InsetSpace \, -2003-04-24 André Pönitz +2003-04-24 André Pönitz * Added eqref support: \begin_inset LatexCommand \eqref{label} diff --git a/lib/lyx2lyx/LyX.py b/lib/lyx2lyx/LyX.py index 1aaed5ebd8..51f261fdc5 100644 --- a/lib/lyx2lyx/LyX.py +++ b/lib/lyx2lyx/LyX.py @@ -73,8 +73,8 @@ format_relation = [("0_06", [200], generate_minor_versions("0.6" , 4)), ("1_1_6_3", [218], ["1.1.6.3","1.1.6.4","1.1"]), ("1_2", [220], generate_minor_versions("1.2" , 4)), ("1_3", [221], generate_minor_versions("1.3" , 7)), - ("1_4", range(222,246), generate_minor_versions("1.4" , 3)), - ("1_5", range(246,264), generate_minor_versions("1.5" , 0))] + ("1_4", range(222,246), generate_minor_versions("1.4" , 4)), + ("1_5", range(246,265), generate_minor_versions("1.5" , 0))] def formats_list(): @@ -257,6 +257,7 @@ class LyX_Base: " Writes the LyX file to self.output." self.set_version() self.set_format() + self.set_textclass() if self.encoding == "auto": self.encoding = get_encoding(self.language, self.encoding, self.format, self.cjk_encoding) @@ -364,6 +365,11 @@ class LyX_Base: self.header[i] = "\\lyxformat %s" % format + def set_textclass(self): + i = find_token(self.header, "\\textclass", 0) + self.header[i] = "\\textclass %s" % self.textclass + + def set_parameter(self, param, value): " Set the value of the header parameter." i = find_token(self.header, '\\' + param, 0) diff --git a/lib/lyx2lyx/lyx_1_5.py b/lib/lyx2lyx/lyx_1_5.py index 18c7a4167a..3b1bc7afc3 100644 --- a/lib/lyx2lyx/lyx_1_5.py +++ b/lib/lyx2lyx/lyx_1_5.py @@ -1245,6 +1245,17 @@ def revert_language_name(document): i = find_token(document.header, "\\language", 0) document.header[i] = "\\language %s" % document.language +# +# \textclass cv -> \textclass simplecv +def convert_cv_textclass(document): + if document.textclass == "cv": + document.textclass = "simplecv" + + +def revert_cv_textclass(document): + if document.textclass == "simplecv": + document.textclass = "cv" + ## # Conversion hub @@ -1268,9 +1279,11 @@ convert = [[246, []], [260, []], [261, [convert_changes]], [262, []], - [263, [normalize_language_name]]] + [263, [normalize_language_name]], + [264, [convert_cv_textclass]]] -revert = [[262, [revert_language_name]], +revert = [[263, [revert_cv_textclass]], + [262, [revert_language_name]], [261, [revert_ascii]], [260, []], [259, [revert_utf8x]], diff --git a/src/buffer.C b/src/buffer.C index bc719884a8..5de13780df 100644 --- a/src/buffer.C +++ b/src/buffer.C @@ -141,7 +141,7 @@ using std::string; namespace { -int const LYX_FORMAT = 263; +int const LYX_FORMAT = 264; } // namespace anon