Got ankiserverctl.py working on my system, installing into the system bin/ and working with config files in another directory.

Conflicts:
	setup.py
This commit is contained in:
David Snopek 2013-11-27 14:46:15 +00:00 committed by jdoe0
parent a18d806b06
commit 33c0fdcd1f

View File

@ -1,4 +1,4 @@
#! /usr/bin/env python2 #!/usr/bin/env python
import os import os
import sys import sys
@ -29,6 +29,13 @@ def startsrv(configpath):
if not configpath: if not configpath:
configpath = SERVERCONFIG 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") devnull = open(os.devnull, "w")
pid = subprocess.Popen( "ankisyncd", pid = subprocess.Popen( "ankisyncd",