Re: A Trivial Python Error

Rich Shepard <[email protected]>
Newsgroups gmane.comp.python.db.pysqlite.user
Message-ID <[email protected]>
On Mon, 27 Nov 2006, Adrian Klaver wrote:

> I don't know how config.py is structured. But my inclination would be create a
> fileConfig class in it with an __init__ that takes as its attributes the pwd
> and projname. You would create an instance of this class in newFile() and
> pass it the attributes from wd.GetPath() and  ted.GetValue(). This instance
> would then be passed to OnNewMod() and the attributes would carry over. This
> solves the problem of what to do if more than person writes to config.py at
> the same time. A class approach would give each call to the class a custom
> set of attributes. This is not tested and runs the risk of different parts of
> the app calling newFile() and getting the same class instance when in fact
> they may need different instances.

   Thanks again, Adrian. Currently, config.py has only the assignments to
variables. I'll make it a class as you suggest, then instantiate that class
in each module that needs those values.

   This is not a multi-user model, so that conflict is not an issue.

Rich

-- 
Richard B. Shepard, Ph.D.               |    The Environmental Permitting
Applied Ecosystem Services, Inc.(TM)    |            Accelerator
<http://www.appl-ecosys.com>     Voice: 503-667-4517      Fax: 503-667-8863
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.