Lukasz Szybalski wrote: > On Thu, Aug 28, 2008 at 10:06 AM, Ian Bicking <[EMAIL PROTECTED]> wrote: >> Lukasz Szybalski wrote: >>> On Thu, Aug 28, 2008 at 9:42 AM, Ian Bicking <[EMAIL PROTECTED]> wrote: >>>> I don't know if you've had luck with this, but sometimes problems like >>>> this >>>> relate to problems importing __init__. ImportErrors in __init__.py >>>> sometimes get swallowed, so they don't keep submodules from being >>>> importable. But this can cause confusion. Probably the problem isn't >>>> find_packages (if it is, you can look at what in your application is >>>> installed, to see if something is missing, or even print out what >>>> find_packages returns, as it's just a list of strings). >>> I'm still looking into it. >>> I'll try to delete all __init__.py and pyc files see if that helps. >>> (Maybe I'll delete it and create an empty one) >> Yes, you'll need empty files. >> >>> If I open python and inside python interpreter I do: >>> >>> from myapp.lib.event import * >>> it works. >>> But it won't work from withing the file. >> Well, you might try: >> >> import myapp >> print 'imported myapp:', myapp >> import myapp.lib >> print 'imported myapp.lib:', myapp.lib >> > > Thanks. That helped. After I was able to import all modules I decided > to import what was in setup.py under console script > I found out that I cannot call my program "myapp" and then use > "myapp.py" in it as it will get confused. REALLY CONFUSED! > > So easy but yet so hard. > > Finally I'm back to the original issue of setting up the config.xml? > Where should I put it? > root install: > /etc/myapp/config.xml > > non-root: > ? > > virtualenv: > ? > Should I maybe create folder inside of virtualenv called "etc" right > next to "bin" or? > What would be an easy way to reference it? "from > some_pythonpath....import __file__" then connect the folders > __file__+"etc"+config.xml? > > What would be a recommended way to do it? How would you do it?
Is your configuration deployment-specific, or some kind of internal configuration? If it's associated with the deployment, I would put it in ENV/etc/myapp.xml, or ENV/etc/myapp/config.xml, i.e., not connected to your myapp source code. -- Ian Bicking : [EMAIL PROTECTED] : http://blog.ianbicking.org _______________________________________________ Paste-users mailing list [email protected] http://webwareforpython.org/cgi-bin/mailman/listinfo/paste-users
