Re: reading optional configuration from a file

2011-11-24 Thread Ben Finney
Ulrich Eckhardt writes: > I have a few tests that require a network connection. Typically, the > target will be localhost on port 2. However, sometimes these > settings differ, so I want to be able to optionally set them. I subscribe to the view that an application's user-configurable settin

Re: reading optional configuration from a file

2011-11-24 Thread Matt Joiner
   REMOTE_HOST = 'localhost'    REMOTE_PORT = 2    try: from .settings import *    except ImportError:        pass This works? If you're using an old version of Python you may need to mess about with __future__. On Thu, Nov 24, 2011 at 10:56 PM, Ulrich Eckhardt wrote: > Hi! > > I have a few

reading optional configuration from a file

2011-11-24 Thread Ulrich Eckhardt
Hi! I have a few tests that require a network connection. Typically, the target will be localhost on port 2. However, sometimes these settings differ, so I want to be able to optionally set them. What I'm currently doing is this: try: from settings import REMOTE_HOST, REMOTE_