From a795cdc0c06389d63d205f13ba34565d56696993 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Fri, 28 Mar 2014 11:31:30 +0100 Subject: [PATCH] force current directory to match the script (#4595) --- server/preview_server.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/preview_server.py b/server/preview_server.py index d4f666f..1461a5f 100755 --- a/server/preview_server.py +++ b/server/preview_server.py @@ -144,6 +144,10 @@ def main(): parser.add_option('--pid', dest='pid') options, args = parser.parse_args() + # force current directory to match the script, to make sure it finds the + # various tools (legi2pdf & odf2legi) + os.chdir(os.path.abspath(os.path.dirname(__file__))) + if not os.path.exists('../legi2pdf/script/db2pdf.py'): print >> sys.stderr, 'W: legi2pdf not found'