\Format lyx lyx LyX "" "" "" ""
\Format lyx13x lyx13 "LyX 1.3.x" "" "" "" "document"
\Format lyx14x lyx14 "LyX 1.4.x" "" "" "" "document"
+\Format lyx15x lyx15 "LyX 1.5.x" "" "" "" "document"
\Format clyx cjklyx "CJK LyX 1.4.x (big5)" "" "" "" "document"
\Format jlyx cjklyx "CJK LyX 1.4.x (euc-jp)" "" "" "" "document"
\Format klyx cjklyx "CJK LyX 1.4.x (euc-kr)" "" "" "" "document"
\converter fig pstex "python -tt $$s/scripts/fig2pstex.py $$i $$o" ""
\converter lyx lyx13x "python -tt $$s/lyx2lyx/lyx2lyx -t 221 $$i > $$o" ""
\converter lyx lyx14x "python -tt $$s/lyx2lyx/lyx2lyx -t 245 $$i > $$o" ""
+\converter lyx lyx15x "python -tt $$s/lyx2lyx/lyx2lyx -t 276 $$i > $$o" ""
\converter lyx clyx "python -tt $$s/lyx2lyx/lyx2lyx -c big5 -t 245 $$i > $$o" ""
\converter lyx jlyx "python -tt $$s/lyx2lyx/lyx2lyx -c euc_jp -t 245 $$i > $$o" ""
\converter lyx klyx "python -tt $$s/lyx2lyx/lyx2lyx -c euc_kr -t 245 $$i > $$o" ""
def checkLatexConfig(check_config, bool_docbook, bool_linuxdoc):
''' Explore the LaTeX configuration '''
print 'checking LaTeX configuration... ',
- # First, remove the files that we want to re-create
- removeFiles(['textclass.lst', 'packages.lst', 'chkconfig.sed'])
- #
- if not check_config:
+ # if --without-latex-config is forced, or if there is no previous
+ # version of textclass.lst, re-generate a default file.
+ if not os.path.isfile('textclass.lst') or not check_config:
+ # remove the files only if we want to regenerate
+ removeFiles(['textclass.lst', 'packages.lst', 'chkconfig.sed'])
+ #
+ # Then, generate a default textclass.lst. In case configure.py
+ # fails, we still have something to start lyx.
print ' default values'
print '+checking list of textclasses... '
tx = open('textclass.lst', 'w')
tx.write(processLayoutFile(file, bool_docbook, bool_linuxdoc))
tx.close()
print '\tdone'
- else:
+ # the following will generate textclass.lst.tmp, and packages.lst.tmp
+ if check_config:
print '\tauto'
removeFiles(['wrap_chkconfig.ltx', 'chkconfig.vars', \
'chkconfig.classes', 'chklayouts.tex'])
pass
if rmcopy: # remove the copied file
removeFiles( [ 'chkconfig.ltx' ] )
+ # if configure successed, move textclass.lst.tmp to textclass.lst
+ # and packages.lst.tmp to packages.lst
+ if os.path.isfile('textclass.lst.tmp') and len(open('textclass.lst.tmp').read()) > 0 \
+ and os.path.isfile('packages.lst.tmp') and len(open('packages.lst.tmp').read()) > 0:
+ shutil.move('textclass.lst.tmp', 'textclass.lst')
+ shutil.move('packages.lst.tmp', 'packages.lst')
def createLaTeXConfig():
''.join(lyxin))
+def checkModulesConfig():
+ removeFiles(['lyxmodules.lst'])
+
+ print '+checking list of modules... '
+ tx = open('lyxmodules.lst', 'w')
+ tx.write('''## This file declares modules and their associated definition files.
+## It has been automatically generated by configure
+## Use "Options/Reconfigure" if you need to update it after a
+## configuration change.
+''')
+ # build the list of available modules
+ foundClasses = []
+ for file in glob.glob( os.path.join('layouts', '*.module') ) + \
+ glob.glob( os.path.join(srcdir, 'layouts', '*.module' ) ) :
+ # valid file?
+ print file
+ if not os.path.isfile(file):
+ continue
+ tx.write(processModuleFile(file, bool_docbook, bool_linuxdoc))
+ tx.close()
+ print '\tdone'
+
+def processModuleFile(file, bool_docbook, bool_linuxdoc):
+ ''' process module file and get a line of result
+
+ Declare lines look like this:
+ \DeclareLyXModule[LaTeX Packages]{Description}{ModuleName}...
+ We expect output:
+ "ModuleName" "filename" "Description" "Packages"
+ "
+ '''
+ p = re.compile(r'\DeclareLyXModule\s*(?:\[([^]]*)\])?{(.*)}{(.*)}')
+ for line in open(file).readlines():
+ res = p.search(line)
+ if res != None:
+ (packages, desc, modname) = res.groups()
+ #check availability...need to add that
+ if packages == None:
+ packages = ""
+ else:
+ pkgs = [s.strip() for s in packages.split(",")]
+ packages = ",".join(pkgs)
+
+ filename = file.split(os.sep)[-1]
+ return '"%s" "%s" "%s" "%s"\n' % (modname, filename, desc, packages)
+ print "Module file without \DeclareLyXModule line. "
+ sys.exit(2)
+
+
+
+
def checkTeXAllowSpaces():
''' Let's check whether spaces are allowed in TeX file names '''
tex_allows_spaces = 'false'
# --without-latex-config can disable lyx_check_config
checkLatexConfig( lyx_check_config and LATEX != '', bool_docbook, bool_linuxdoc)
createLaTeXConfig()
+ checkModulesConfig() #lyx_check_config and LATEX != '')
removeTempFiles()