return
+def checkUpgradeWin():
+ ''' Check for upgrade from previous version '''
+ cwd = os.getcwd()
+ basename = os.path.basename(cwd)
+ if basename != "LyX":
+ return
+ lyxrc = os.path.join(cwd, outfile)
+ if os.path.isfile(lyxrc):
+ return
+ olddir = os.path.join(os.path.dirname(cwd), "LyX2.3")
+ if not os.path.isdir(oldir):
+ return
+ logger.info('Copying ' + olddir + ' into ' + cwd)
+ copy_tree(olddir, cwd, True)
+
+
def createDirectories():
''' Create the build directories if necessary '''
for dir in ['bind', 'clipart', 'doc', 'examples', 'images', 'kbd',
PPLATEX = LATEX
if dtl_tools:
# Windows only: DraftDVI
- addToRC(r'''\converter latex dvi2 "%s" "latex"
+ addToRC(r'''\converter latex dvi2 "%s" "latex,hyperref-driver=dvips"
\converter dvi2 dvi "python -tt $$s/scripts/clean_dvi.py $$i $$o" ""''' % PPLATEX)
else:
- addToRC(r'\converter latex dvi "%s" "latex"' % PPLATEX)
+ addToRC(r'\converter latex dvi "%s" "latex,hyperref-driver=dvips"' % PPLATEX)
# no latex
if LATEX != '':
# Check if latex is usable
rc_entry = [r'''\converter latex lyx "%% -f $$i $$o" ""
\converter latexclipboard lyx "%% -fixedenc utf8 -f $$i $$o" ""
\converter literate lyx "%% -n -m noweb -f $$i $$o" ""
-\converter sweave lyx "%% -n -m sweave -f $$i $$o" "needauth"
-\converter knitr lyx "%% -n -m knitr -f $$i $$o" "needauth"'''], not_found = 'tex2lyx')
+\converter sweave lyx "%% -n -m sweave -f $$i $$o" ""
+\converter knitr lyx "%% -n -m knitr -f $$i $$o" ""'''], not_found = 'tex2lyx')
if path == '':
logger.warning("Failed to find tex2lyx on your system.")
setEnviron()
if sys.platform == 'darwin' and len(version_suffix) > 0:
checkUpgrade()
+ if os.name == 'nt':
+ checkUpgradeWin()
createDirectories()
dtl_tools = checkDTLtools()
## Write the first part of outfile