Rudy's personal scratchpad - PyDS 25.4.2004

2004-04-25

I'm running 2 instances of PyDS as a Windows service now.

I wanted to use PyDS for some of my other hobbies too and I didn't want to mix with this instance. I prefer to use this one only for computer related things. I guess I'll move the jokes too.

There were 2 problems I had to take care of: the location of the data files on my laptop and the serverport.

The serverport could easily be configured in %PYDS_HOME%etcPyDSConfig.py but I found it to be easier adding one line to pandora-start.py.

PyDS first looks for the PYDS_HOME environment variable to find the location of its homedir. If it isn't found, it looks for HOME. On Windows, if that failes also it uses:

home = os.environ['HOMEDRIVE'] + os.environ['HOMEPATH'] 

The problem here is that you can only specify one location. The solution was to set the PYDS_HOME environment variable in pandora-start.py as you can see below:

import sys
import getopt
import os

os.environ['PYDS_HOME'] = r"G:\PyDS\Pandora"

import PyDS.ConfigLoader

_PyDS.serverport = 4335

import PyDS.Context
import PyDS.Translation

print _("Loading desktop server ...")

import PyDS.Server

(opts, args) = getopt.getopt(sys.argv[1:], 'fved')

for o in opts:
    if o[0] == '-f':
        _PyDS.daemon = 0
    elif o[0] == '-v':
        _PyDS.verbose = 1
    elif o[0] == '-e':
        _PyDS.echoLog = 1
    elif o[0] == '-d':
        import libwadpy

PyDS.Server.start_server(daemon=_PyDS.daemon)
posted at 10:10:40    #    comment []    trackback []
April 2004
MoTuWeThFrSaSu
    1 2 3 4
5 6 7 8 91011
12131415161718
19202122232425
2627282930  
Mar
2004
 May
2004

Anything related to PyDS. What I like about it. The problems I encounter and hopefully how I solve them.

XML-Image Letterimage

© 2004, Rudy Schockaert