Revert part of r37496. This was wrong.

Probalby we have a better "isLyXFile()" routine for use also in gather_files().



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37504 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2011-02-05 14:04:28 +00:00
parent fc4324b07c
commit 1aad2779e4

View File

@ -24,7 +24,7 @@ from sets import Set
lyx2lyx = None lyx2lyx = None
# Pre-compiled regular expressions. # Pre-compiled regular expressions.
re_extn = re.compile("\.[^.]*$") re_lyxfile = re.compile("\.lyx$")
re_input = re.compile(r'^(.*)\\(input|include){(\s*)(\S+)(\s*)}.*$') re_input = re.compile(r'^(.*)\\(input|include){(\s*)(\S+)(\s*)}.*$')
re_package = re.compile(r'^(.*)\\(usepackage){(\s*)(\S+)(\s*)}.*$') re_package = re.compile(r'^(.*)\\(usepackage){(\s*)(\S+)(\s*)}.*$')
re_class = re.compile(r'^(\\)(textclass)(\s+)(\S+)$') re_class = re.compile(r'^(\\)(textclass)(\s+)(\S+)$')
@ -71,7 +71,7 @@ def abspath(name):
def gather_files(curfile, incfiles): def gather_files(curfile, incfiles):
" Recursively gather files." " Recursively gather files."
curdir = os.path.dirname(abspath(curfile)) curdir = os.path.dirname(abspath(curfile))
is_lyxfile = re_extn.search(curfile) is_lyxfile = re_lyxfile.search(curfile)
if is_lyxfile: if is_lyxfile:
lyx2lyx_cmd = 'python "%s" "%s"' % (lyx2lyx, curfile) lyx2lyx_cmd = 'python "%s" "%s"' % (lyx2lyx, curfile)
l2l_status, l2l_stdout = run_cmd(lyx2lyx_cmd) l2l_status, l2l_stdout = run_cmd(lyx2lyx_cmd)
@ -185,7 +185,7 @@ def main(argv):
if archiver == "tar": if archiver == "tar":
ar_cmd = "tar cf" ar_cmd = "tar cf"
ar_name = re_extn.sub(".tar", abspath(lyxfile)) ar_name = re_lyxfile.sub(".tar", abspath(lyxfile))
# Archive will be compressed if either gzip or bzip2 are available # Archive will be compressed if either gzip or bzip2 are available
compress, full_path = find_exe(["gzip", "bzip2"], extlist, path) compress, full_path = find_exe(["gzip", "bzip2"], extlist, path)
if compress == "gzip": if compress == "gzip":
@ -194,7 +194,7 @@ def main(argv):
ext = ".bz2" ext = ".bz2"
elif archiver == "zip": elif archiver == "zip":
ar_cmd = "zip" ar_cmd = "zip"
ar_name = re_extn.sub(".zip", abspath(lyxfile)) ar_name = re_lyxfile.sub(".zip", abspath(lyxfile))
compress = None compress = None
else: else:
error("Unable to find either tar or zip.") error("Unable to find either tar or zip.")