From 33c0fdcd1fb99046a4fe998b4cd3677bf13c587d Mon Sep 17 00:00:00 2001 From: David Snopek Date: Wed, 27 Nov 2013 14:46:15 +0000 Subject: [PATCH] Got ankiserverctl.py working on my system, installing into the system bin/ and working with config files in another directory. Conflicts: setup.py --- ankisyncctl.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ankisyncctl.py b/ankisyncctl.py index 0ac9cd8..2d19d34 100755 --- a/ankisyncctl.py +++ b/ankisyncctl.py @@ -1,4 +1,4 @@ -#! /usr/bin/env python2 +#!/usr/bin/env python import os import sys @@ -29,6 +29,13 @@ def startsrv(configpath): if not configpath: configpath = SERVERCONFIG + # We change to the directory containing the config file + # so that all the paths will be relative to it. + configdir = os.path.dirname(configpath) + if configdir != '': + os.chdir(configdir) + configpath = os.path.basename(configpath) + devnull = open(os.devnull, "w") pid = subprocess.Popen( "ankisyncd",