On Aug 29, 2007, at 9:09 PM, Nate Lowrie wrote:

> It is definitely a namespace issue.  Sounds like a good idea though.
> Are you doing the importation when dabo is first imported?

        No, it is during the app's setup() method.

> If not, it sounds like the current directory is not what you think  
> it is and it
> is using dabo's directory instead.

        I've put lots of 'print os.getcwd()' messages to test that, and it  
correctly returns the starting directory.

> Can you post the code?

        This is called from dApp.setup(), right after _initDB().

        def _initBiz(self):
                """If there is a 'biz' directory that can be imported, import 
it so
                that other objects in the system can reference bizobjs using the
                'self.Application.biz' syntax
                """
                curdir = os.getcwd()
                print "CURR DIR", curdir
                bizdir = os.path.join(curdir, "biz")
                if os.path.exists(bizdir):
                        try:
                                sys.path.insert(0, curdir)
                                import biz
                                print "BIZ", biz
                                self.biz = biz
                        except ImportError, e:
                                print "IMPORT:", e
                                pass

        And yes, there is a 'biz' directory containing bizobj class code,  
and an __init__.py file that makes it a valid module. If I run the  
Python interpreter from the same directory and issue 'import biz',  
the correct biz module is imported, whether or not I first issue  
'import dabo'.

-- Ed Leafe
-- http://leafe.com
-- http://dabodev.com




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/dabo-dev/[EMAIL PROTECTED]

Reply via email to