-class NewFile(LyX_base):
- " This class is to create new LyX files."
- def set_header(self, **params):
- # set default values
- self.header.extend([
- "#LyX xxxx created this file."
- "For more info see http://www.lyx.org/",
- "\\lyxformat xxx",
- "\\begin_document",
- "\\begin_header",
- "\\textclass article",
- "\\language english",
- "\\inputencoding auto",
- "\\font_roman default",
- "\\font_sans default",
- "\\font_typewriter default",
- "\\font_default_family default",
- "\\font_sc false",
- "\\font_osf false",
- "\\font_sf_scale 100",
- "\\font_tt_scale 100",
- "\\graphics default",
- "\\paperfontsize default",
- "\\papersize default",
- "\\use_geometry false",
- "\\use_amsmath 1",
- "\\cite_engine basic",
- "\\use_bibtopic false",
- "\\paperorientation portrait",
- "\\secnumdepth 3",
- "\\tocdepth 3",
- "\\paragraph_separation indent",
- "\\defskip medskip",
- "\\quotes_language english",
- "\\papercolumns 1",
- "\\papersides 1",
- "\\paperpagestyle default",
- "\\tracking_changes false",
- "\\end_header"])
-
- self.format = get_end_format()
- for param in params:
- self.set_parameter(param, params[param])
-
-
- def set_body(self, paragraphs):
- self.body.extend(['\\begin_body',''])
-
- for par in paragraphs:
- self.body.extend(par.asLines())
-
- self.body.extend(['','\\end_body', '\\end_document'])
-
-
-class Paragraph:
- # unfinished implementation, it is missing the Text and Insets
- # representation.
- " This class represents the LyX paragraphs."
- def __init__(self, name, body=[], settings = [], child = []):
- """ Parameters:
- name: paragraph name.
- body: list of lines of body text.
- child: list of paragraphs that descend from this paragraph.
- """
- self.name = name
- self.body = body
- self.settings = settings
- self.child = child
-
- def asLines(self):
- """ Converts the paragraph to a list of strings, representing
- it in the LyX file."""
-
- result = ['','\\begin_layout %s' % self.name]
- result.extend(self.settings)
- result.append('')
- result.extend(self.body)
- result.append('\\end_layout')
-
- if not self.child:
- return result
-
- result.append('\\begin_deeper')
- for node in self.child:
- result.extend(node.asLines())
- result.append('\\end_deeper')
-
- return result
+# FIXME: header settings are completely outdated, don't use like this
+#class NewFile(LyX_base):
+# " This class is to create new LyX files."
+# def set_header(self, **params):
+# # set default values
+# self.header.extend([
+# "#LyX xxxx created this file."
+# "For more info see http://www.lyx.org/",
+# "\\lyxformat xxx",
+# "\\begin_document",
+# "\\begin_header",
+# "\\textclass article",
+# "\\language english",
+# "\\inputencoding auto",
+# "\\font_roman default",
+# "\\font_sans default",
+# "\\font_typewriter default",
+# "\\font_default_family default",
+# "\\font_sc false",
+# "\\font_osf false",
+# "\\font_sf_scale 100",
+# "\\font_tt_scale 100",
+# "\\graphics default",
+# "\\paperfontsize default",
+# "\\papersize default",
+# "\\use_geometry false",
+# "\\use_amsmath 1",
+# "\\cite_engine basic",
+# "\\use_bibtopic false",
+# "\\use_indices false",
+# "\\paperorientation portrait",
+# "\\secnumdepth 3",
+# "\\tocdepth 3",
+# "\\paragraph_separation indent",
+# "\\defskip medskip",
+# "\\quotes_language english",
+# "\\papercolumns 1",
+# "\\papersides 1",
+# "\\paperpagestyle default",
+# "\\tracking_changes false",
+# "\\end_header"])
+
+# self.format = get_end_format()
+# for param in params:
+# self.set_parameter(param, params[param])
+
+
+# def set_body(self, paragraphs):
+# self.body.extend(['\\begin_body',''])
+
+# for par in paragraphs:
+# self.body.extend(par.asLines())
+
+# self.body.extend(['','\\end_body', '\\end_document'])
+
+
+# Part of an unfinished attempt to make lyx2lyx gave a more
+# structured view of the document.
+#class Paragraph:
+# # unfinished implementation, it is missing the Text and Insets
+# # representation.
+# " This class represents the LyX paragraphs."
+# def __init__(self, name, body=[], settings = [], child = []):
+# """ Parameters:
+# name: paragraph name.
+# body: list of lines of body text.
+# child: list of paragraphs that descend from this paragraph.
+# """
+# self.name = name
+# self.body = body
+# self.settings = settings
+# self.child = child
+
+# def asLines(self):
+# """ Converts the paragraph to a list of strings, representing
+# it in the LyX file."""
+
+# result = ['','\\begin_layout %s' % self.name]
+# result.extend(self.settings)
+# result.append('')
+# result.extend(self.body)
+# result.append('\\end_layout')
+
+# if not self.child:
+# return result
+
+# result.append('\\begin_deeper')
+# for node in self.child:
+# result.extend(node.asLines())
+# result.append('\\end_deeper')
+
+# return result