lyx_mirror/development/tools/updatelayouts.py
José Matos 3f03f0a447 Move all python shebangs from /usr/bin/env to python3.
The change is only relevant to development as all the call to python scripts is done
calling C++ os::python that invoques the appropriate python version.

The change is two fold, on one hand remove all the uses of /usr/bin/env for python.

On the other hand rename all the calls to python from python to python3 making it explicit
and being compliant with PEP 394 -- The "python" Command on Unix-Like Systems:
https://www.python.org/dev/peps/pep-0394/

Remove the sheebang from src/graphics/GraphicsConverter.cpp because it is not necessary.

Some small whitespace changes.
2018-12-29 19:14:41 +00:00

42 lines
1.1 KiB
Python
Executable File

#! /usr/bin/python3
# -*- coding: utf-8 -*-
# file updatelayouts.py
# This file is part of LyX, the document processor.
# Licence details can be found in the file COPYING.
# author Georg Baum
# Full author contact details are available in file CREDITS
# This script converts all layout files to current format
# The old files are backuped with extension ".old"
import os, re, string, sys, subprocess, tempfile, shutil
sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), "../../lib/scripts"))
from layout2layout import main as layout2layout
def main(argv):
toolsdir = os.path.dirname(argv[0])
dirs = []
dirs.append(os.path.join(toolsdir, '../../lib/layouts'))
dirs.append(os.path.join(toolsdir, '../../lib/citeengines'))
for directory in dirs:
os.chdir(directory)
for i in os.listdir("."):
(base, ext) = os.path.splitext(i)
if ext == ".old":
continue
args = ["layout2layout", i + ".old", i]
shutil.copy(args[2], args[1])
layout2layout(args)
return 0
if __name__ == "__main__":
main(sys.argv)