X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=lib%2Fscripts%2Ftex_copy.py;h=224406840c34c0d0a2e3194fe32f7480247604c9;hb=dce6c8875c71c43610971408da5d59018fb9dc38;hp=6c634c115e10bac01f3ba1659fc790d1d009eb90;hpb=e3671722567785da470c34d76a77ba0968e0cef9;p=lyx.git diff --git a/lib/scripts/tex_copy.py b/lib/scripts/tex_copy.py index 6c634c115e..224406840c 100644 --- a/lib/scripts/tex_copy.py +++ b/lib/scripts/tex_copy.py @@ -1,5 +1,5 @@ #! /usr/bin/env python -# -*- coding: iso-8859-1 -*- +# -*- coding: utf-8 -*- # file tex_copy.py # This file is part of LyX, the document processor. @@ -11,7 +11,7 @@ # Full author contact details are available in file CREDITS # Usage: -# tex_copy.py from file> +# tex_copy.py # This script will copy a file to . # is no exact copy of , but any occurence of @@ -54,6 +54,8 @@ def main(argv): latex_base, latex_ext = os.path.splitext(latex_file) # Read the input file and write the output file + if(not os.path.isfile(abs_from_file)): + error("%s is not a valid file.\n" % abs_from_file) from_file = open(abs_from_file, 'rb') to_file = open(abs_to_file, 'wb') lines = from_file.readlines()