Re: [web2py] Re: What is the convention for using web2py/site-packages for GAE?

2011-05-05 Thread howesc
i tracked down the error with _TEST(), and created a solution.  not at all 
sure that this is correct for web2py, but you can see my patch in the ticket 
i created: http://code.google.com/p/web2py/issues/detail?id=261


Re: [web2py] Re: What is the convention for using web2py/site-packages for GAE?

2011-05-03 Thread howesc
ok, i'll play with it more.

i just upgraded to the latest release yesterday, but in older versions i 
noticed that sometimes site-packages would be on the path and sometimes not, 
but i only have had that problem in the SDK and a restart usually solves it 
so i didn't worry too much about it.

thanks again,

cfh


Re: [web2py] Re: What is the convention for using web2py/site-packages for GAE?

2011-05-03 Thread Jonathan Lundell
On May 3, 2011, at 1:09 PM, howesc wrote:
> Jonathan,
> 
> I added the logging statements and learned some more things:
>  - when running the controllers directly it seems to add site-packages 
> properly
>  - when running the controllers via the _TEST() function for executing 
> doctests it fails to add site-packages to the path
>  - after trying to run the tests and failing to add site-packages to the 
> path, that environment is used for the next normal web-request and does not 
> have site-packages on the path.
> 
> i hope that helps.  i'm trying to build some automated tests, and that 
> suddenly broke the path generation.
> 
> let me know if i can help track this down further.

I don't know enough about _TEST to have an insight into that aspect of the 
problem, but it sounds like a good clue for someone who does

One thing you might try, though, is to make sure that gluon.main is being 
imported at some point along the way. I figure it should be, because gaehandler 
does it, but again I'm not sure what _TEST is doing.



Re: [web2py] Re: What is the convention for using web2py/site-packages for GAE?

2011-05-03 Thread howesc
Jonathan,

I added the logging statements and learned some more things:
 - when running the controllers directly it seems to add site-packages 
properly
 - when running the controllers via the _TEST() function for executing 
doctests it fails to add site-packages to the path
 - after trying to run the tests and failing to add site-packages to the 
path, that environment is used for the next normal web-request and does not 
have site-packages on the path.

i hope that helps.  i'm trying to build some automated tests, and that 
suddenly broke the path generation.

let me know if i can help track this down further.

christian


Re: [web2py] Re: What is the convention for using web2py/site-packages for GAE?

2011-05-03 Thread Jonathan Lundell
On May 3, 2011, at 12:27 PM, howesc wrote:
> Jonathan,
> 
> Just upgraded to Version 1.95.1 (2011-04-25 15:04:14)
> 
> running GAE SDK, i logged sys.path at the start of a controller, and this is 
> it (note no web2py/site-packages):
> 
> '/Users/cfhowes/clients/pump/source/web2py', 
> '/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine',
>  
> '/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/antlr3',
>  
> '/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/django_0_96',
>  
> '/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/fancy_urllib',
>  
> '/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/ipaddr',
>  
> '/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webob',
>  
> '/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/yaml/lib',
>  
> '/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/simplejson',
>  
> '/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/graphy',
>  
> '/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine',
>  '/Users/cfhowes/clients/pump/source/scripts', 
> '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages',
>  '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python25.zip', 
> '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5', 
> '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-darwin',
>  
> '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-mac',
>  
> '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-mac/lib-scriptpackages',
>  
> '/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python', 
> '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-tk',
>  
> '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload',
>  '/Library/Python/2.5/site-packages', 
> '/Library/Python/2.5/site-packages/PIL', 
> '/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/PyObjC',
>  
> '/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/wx-2.8-mac-unicode'
> 
> i tried to run from trunk but got some other error in the framework, so i'm 
> staying out of that for the moment.

OK, thanks.

Take a look in gluon.main and verify that there's a call near the top to 
create_missing_folders().

Then in gluon.admin.add_path_first, try logging sys.path and path (the 
argument) after the sys.path assignment.





Re: [web2py] Re: What is the convention for using web2py/site-packages for GAE?

2011-05-03 Thread howesc
Jonathan,

Just upgraded to Version 1.95.1 (2011-04-25 15:04:14)

running GAE SDK, i logged sys.path at the start of a controller, and this is 
it (note no web2py/site-packages):

'/Users/cfhowes/clients/pump/source/web2py', 
'/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine',
 
'/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/antlr3',
 
'/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/django_0_96',
 
'/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/fancy_urllib',
 
'/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/ipaddr',
 
'/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webob',
 
'/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/yaml/lib',
 
'/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/simplejson',
 
'/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/graphy',
 
'/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine',
 
'/Users/cfhowes/clients/pump/source/scripts', 
'/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages',
 
'/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python25.zip', 
'/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5', 
'/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-darwin',
 
'/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-mac',
 
'/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-mac/lib-scriptpackages',
 
'/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python', 
'/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-tk',
 
'/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload',
 
'/Library/Python/2.5/site-packages', 
'/Library/Python/2.5/site-packages/PIL', 
'/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/PyObjC',
 
'/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/wx-2.8-mac-unicode'

i tried to run from trunk but got some other error in the framework, so i'm 
staying out of that for the moment.


Re: [web2py] Re: What is the convention for using web2py/site-packages for GAE?

2011-03-27 Thread Jonathan Lundell
On Mar 25, 2011, at 3:53 PM, ChrisM wrote:
> 
> wondering if this has  been resolved as i have copied a package into
> site packages using latest
> web2py and GAE dev_appserver cant find it.

Try logging sys.path and see if site-packages is there. You should see the 
web2py root, gluon, and site-packages.

> chrism
> 
> On Feb 13, 11:46 am, Carl  wrote:
>> On Feb 12, 4:03 pm, Jonathan Lundell  wrote:
>> 
>> 
>> 
>>> On Feb 12, 2011, at 3:12 AM, Carl wrote:
>> 
 I've avoided editing oauth10a_account.py by moving the directory
 oauth2 to web2py (and keeping httplib2 inside oauth2.
>> 
 Not happy that I've put this in Web2py's root but I've avoided editing
 the framework source and don't need to worry about overwriting files
 when I upgrade Web2py.
>> 
 On Feb 11, 1:46 pm, Carl  wrote:
> I'm using OAuth/LinkedIn on GAE.
>> 
> To get oauth/LinkedIn to run on dev_appserver/GAE I had to copy
> directory oauth2 from web2py/site-packages to web2py/gluon/contrib and
> httplib2 from site-packages to web2py/gluon/contrib/oauth2
>> 
> Then in oauth10a_account.py change "import oauth2 as oauth" to "import
> gluon.contrib.oauth2 as oauth".
>> 
> Bingo.
>> 
> But.. is there a convention that will make web2py upgrades
> straightforward?
>> 
>>> Two questions:
>> 
>>> 1. What web2py version are you using?
>> 
>>> B. What happens when oauth2 is in site-packages?
>> 
>>> 3. Where is your import? (OK, three questions.)
>> 
>>> Recently (and I'll have to do some research to find out exactly when), we 
>>> made some changes in this area. It used to be that the handling of web2py's 
>>> additions to sys.path were somewhat erratic, and dependent on which handler 
>>> was in use. The changes were to make it consistent across handlers. In 
>>> particular (at least in the trunk), both the web2py root and site-packages 
>>> should be at the beginning of sys.path by the time you do your import.
>> 
>>> Could you please log sys.path at the time you do your import (or save a 
>>> copy and display it later)? Thanks.
>> 
>> 1. I'm using Web2py 1.89.1. Have I been caught out by recent changes?
>> In any case, I'll update to the latest (so much recent activity!)
>> 
>> 2. dev_appserver reports that there is an invalid character in 'site-
>> packages'. I took that to be the hyphen.
>> 
>> 3. I have 2 imports.
>> gluon/contrib/login_methods/oauth10a_account.py line 15 import oauth2
>> as oauth
>> applications/init/modules/user.py (my own file) import oauth2 as oauth
>> So I need a solution that works from these two locations




[web2py] Re: What is the convention for using web2py/site-packages for GAE?

2011-03-25 Thread ChrisM
wondering if this has  been resolved as i have copied a package into
site packages using latest
web2py and GAE dev_appserver cant find it.
chrism

On Feb 13, 11:46 am, Carl  wrote:
> On Feb 12, 4:03 pm, Jonathan Lundell  wrote:
>
>
>
> > On Feb 12, 2011, at 3:12 AM, Carl wrote:
>
> > > I've avoided editing oauth10a_account.py by moving the directory
> > > oauth2 to web2py (and keeping httplib2 inside oauth2.
>
> > > Not happy that I've put this in Web2py's root but I've avoided editing
> > > the framework source and don't need to worry about overwriting files
> > > when I upgrade Web2py.
>
> > > On Feb 11, 1:46 pm, Carl  wrote:
> > >> I'm using OAuth/LinkedIn on GAE.
>
> > >> To get oauth/LinkedIn to run on dev_appserver/GAE I had to copy
> > >> directory oauth2 from web2py/site-packages to web2py/gluon/contrib and
> > >> httplib2 from site-packages to web2py/gluon/contrib/oauth2
>
> > >> Then in oauth10a_account.py change "import oauth2 as oauth" to "import
> > >> gluon.contrib.oauth2 as oauth".
>
> > >> Bingo.
>
> > >> But.. is there a convention that will make web2py upgrades
> > >> straightforward?
>
> > Two questions:
>
> > 1. What web2py version are you using?
>
> > B. What happens when oauth2 is in site-packages?
>
> > 3. Where is your import? (OK, three questions.)
>
> > Recently (and I'll have to do some research to find out exactly when), we 
> > made some changes in this area. It used to be that the handling of web2py's 
> > additions to sys.path were somewhat erratic, and dependent on which handler 
> > was in use. The changes were to make it consistent across handlers. In 
> > particular (at least in the trunk), both the web2py root and site-packages 
> > should be at the beginning of sys.path by the time you do your import.
>
> > Could you please log sys.path at the time you do your import (or save a 
> > copy and display it later)? Thanks.
>
> 1. I'm using Web2py 1.89.1. Have I been caught out by recent changes?
> In any case, I'll update to the latest (so much recent activity!)
>
> 2. dev_appserver reports that there is an invalid character in 'site-
> packages'. I took that to be the hyphen.
>
> 3. I have 2 imports.
> gluon/contrib/login_methods/oauth10a_account.py line 15 import oauth2
> as oauth
> applications/init/modules/user.py (my own file) import oauth2 as oauth
> So I need a solution that works from these two locations


[web2py] Re: What is the convention for using web2py/site-packages for GAE?

2011-02-13 Thread Carl


On Feb 12, 4:03 pm, Jonathan Lundell  wrote:
> On Feb 12, 2011, at 3:12 AM, Carl wrote:
>
> > I've avoided editing oauth10a_account.py by moving the directory
> > oauth2 to web2py (and keeping httplib2 inside oauth2.
>
> > Not happy that I've put this in Web2py's root but I've avoided editing
> > the framework source and don't need to worry about overwriting files
> > when I upgrade Web2py.
>
> > On Feb 11, 1:46 pm, Carl  wrote:
> >> I'm using OAuth/LinkedIn on GAE.
>
> >> To get oauth/LinkedIn to run on dev_appserver/GAE I had to copy
> >> directory oauth2 from web2py/site-packages to web2py/gluon/contrib and
> >> httplib2 from site-packages to web2py/gluon/contrib/oauth2
>
> >> Then in oauth10a_account.py change "import oauth2 as oauth" to "import
> >> gluon.contrib.oauth2 as oauth".
>
> >> Bingo.
>
> >> But.. is there a convention that will make web2py upgrades
> >> straightforward?
>
> Two questions:
>
> 1. What web2py version are you using?
>
> B. What happens when oauth2 is in site-packages?
>
> 3. Where is your import? (OK, three questions.)
>
> Recently (and I'll have to do some research to find out exactly when), we 
> made some changes in this area. It used to be that the handling of web2py's 
> additions to sys.path were somewhat erratic, and dependent on which handler 
> was in use. The changes were to make it consistent across handlers. In 
> particular (at least in the trunk), both the web2py root and site-packages 
> should be at the beginning of sys.path by the time you do your import.
>
> Could you please log sys.path at the time you do your import (or save a copy 
> and display it later)? Thanks.

1. I'm using Web2py 1.89.1. Have I been caught out by recent changes?
In any case, I'll update to the latest (so much recent activity!)

2. dev_appserver reports that there is an invalid character in 'site-
packages'. I took that to be the hyphen.

3. I have 2 imports.
gluon/contrib/login_methods/oauth10a_account.py line 15 import oauth2
as oauth
applications/init/modules/user.py (my own file) import oauth2 as oauth
So I need a solution that works from these two locations


Re: [web2py] Re: What is the convention for using web2py/site-packages for GAE?

2011-02-12 Thread Jonathan Lundell
On Feb 12, 2011, at 3:12 AM, Carl wrote:
> 
> I've avoided editing oauth10a_account.py by moving the directory
> oauth2 to web2py (and keeping httplib2 inside oauth2.
> 
> Not happy that I've put this in Web2py's root but I've avoided editing
> the framework source and don't need to worry about overwriting files
> when I upgrade Web2py.
> 
> On Feb 11, 1:46 pm, Carl  wrote:
>> I'm using OAuth/LinkedIn on GAE.
>> 
>> To get oauth/LinkedIn to run on dev_appserver/GAE I had to copy
>> directory oauth2 from web2py/site-packages to web2py/gluon/contrib and
>> httplib2 from site-packages to web2py/gluon/contrib/oauth2
>> 
>> Then in oauth10a_account.py change "import oauth2 as oauth" to "import
>> gluon.contrib.oauth2 as oauth".
>> 
>> Bingo.
>> 
>> But.. is there a convention that will make web2py upgrades
>> straightforward?

Two questions:

1. What web2py version are you using?

B. What happens when oauth2 is in site-packages?

3. Where is your import? (OK, three questions.)

Recently (and I'll have to do some research to find out exactly when), we made 
some changes in this area. It used to be that the handling of web2py's 
additions to sys.path were somewhat erratic, and dependent on which handler was 
in use. The changes were to make it consistent across handlers. In particular 
(at least in the trunk), both the web2py root and site-packages should be at 
the beginning of sys.path by the time you do your import.

Could you please log sys.path at the time you do your import (or save a copy 
and display it later)? Thanks.

[web2py] Re: What is the convention for using web2py/site-packages for GAE?

2011-02-12 Thread Carl
I've avoided editing oauth10a_account.py by moving the directory
oauth2 to web2py (and keeping httplib2 inside oauth2.

Not happy that I've put this in Web2py's root but I've avoided editing
the framework source and don't need to worry about overwriting files
when I upgrade Web2py.

On Feb 11, 1:46 pm, Carl  wrote:
> I'm using OAuth/LinkedIn on GAE.
>
> To get oauth/LinkedIn to run on dev_appserver/GAE I had to copy
> directory oauth2 from web2py/site-packages to web2py/gluon/contrib and
> httplib2 from site-packages to web2py/gluon/contrib/oauth2
>
> Then in oauth10a_account.py change "import oauth2 as oauth" to "import
> gluon.contrib.oauth2 as oauth".
>
> Bingo.
>
> But.. is there a convention that will make web2py upgrades
> straightforward?