mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-13 17:20:55 +00:00
bc8510eacd
- add missing whitespace in error report for a script of inset external. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_3_X@8369 a592a061-630c-0410-9148-cb99ea01b6c8
25 lines
627 B
Python
25 lines
627 B
Python
#! /usr/bin/env python
|
|
# This is a general wrapper script that will allow
|
|
# us to maintain security in the external material
|
|
# insets.
|
|
# Use like this:
|
|
# general_command_wrapper.py stdin-filename stdout-filename command args
|
|
# Use "-" for stdin-filename and stdout-filename to use the normal stdio
|
|
|
|
import sys
|
|
import os
|
|
|
|
if sys.argv[1] != "-":
|
|
os.close(0)
|
|
sys.stdin = open(sys.argv[1],"r")
|
|
if sys.argv[2] != "-":
|
|
print "Redirecting " + sys.argv[2]
|
|
os.close(1)
|
|
os.close(2)
|
|
sys.stdout = open(sys.argv[2],"w")
|
|
sys.stderr = open(sys.argv[2],"w")
|
|
|
|
os.execvp(sys.argv[3], sys.argv[3:])
|
|
print "Could not run " + sys.argv[3]
|
|
|