I know this is really python but I am writing a test.py for the
proposed plugin/db stuff where test.py is located in web2py/plugin/
db.  In test.py I want to import from gluon.sql.

I've managed to do this by appending an item to sys.path by:

        gluonpath=__file__.replace('.pyc','.py')
        gluonpath=gluonpath.replace('.py','')
        gluonpath=gluonpath.replace(__name__,'../..')
        sys.path.append(gluonpath)
        from gluon.sql import drivers

... but there must be a more elegant way.  can anyone help me out of
my ignorance please.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to