just be sure that the same sys.path is then in scheduler, shell, tests, and 
so on ^_^
BTW: 

from gluon.contrib import something

should be the recommended way to import something from contrib
let's not forget all the hassle we've been into dealing with

from gluon import module

vs

import module

and be smart about it ^___^

BTW2: Isn't including contrib in sys.path just the same thing as shipping 
pg8000 and all the "nifty importers" in site-packages ?!?!?

On Monday, March 3, 2014 2:23:59 PM UTC+1, Massimo Di Pierro wrote:
>
> I agree with Niphlod. I do not like packages that need to be installed to 
> work and explicit relative imports is better than absolute imports.
> Yet, this is not the only package we had to tweak to include in contrib. 
> So this may come up again. Any objection to include contrib in sys.path?
>
> On Sunday, 2 March 2014 18:29:45 UTC-6, Niphlod wrote:
>>
>> as long as you can use it without installing it in sys.path, then it's 
>> fine. If not, it can't be shipped with web2py, just supported as a module.
>> I don't like packages that needs a complete install to work. It's true 
>> that we have venvs for quite some time now, but a module with less than 10 
>> files can accomodate for relative imports quite finely without impairing 
>> the code-reader in everyone of us :P
>>
>> BTW, search for "explicit relative imports" in that doc :-P
>>
>> On Sunday, March 2, 2014 7:24:58 PM UTC+1, Tony Locke wrote:
>>>
>>> Hi, I'm a contributor to pg8000 and if there are any changes you need to 
>>> get pg8000 working with web2py, let me know. Looking at the absolute import 
>>> problem, PEP8 seems to think absolute imports are the way to go:
>>>
>>> http://legacy.python.org/dev/peps/pep-0008/<http://www.google.com/url?q=http%3A%2F%2Flegacy.python.org%2Fdev%2Fpeps%2Fpep-0008%2F&sa=D&sntz=1&usg=AFQjCNG8T4Krvic_V8TCmT4iog4T5e4pyg>
>>>
>>> (search for 'relative' in the text) but I'm open to persuasion :-)
>>>
>>> Cheers,
>>>
>>> Tony.
>>>
>>> On Saturday, 1 March 2014 11:18:43 UTC, Joe Barnhart wrote:
>>>>
>>>> Hi Mariano --
>>>>
>>>> I'd like to encourage you to keep making pg8000 a viable alternative 
>>>> for web2py.  I started with it but had to change to psycopg2 because of 
>>>> some issues that postgres handled better under the psy driver.  But I 
>>>> think 
>>>> pypy could be the future of python and it won't support a driver like 
>>>> psycopg2 -- but it could support pg8000 since it is all python.
>>>>
>>>> It's just good to have an alternative because no driver does it all.
>>>>
>>>> -- Joe B.
>>>>
>>>> On Tuesday, February 25, 2014 6:55:17 PM UTC-8, Mariano Reingart wrote:
>>>>>
>>>>> Hi Horst:
>>>>>
>>>>> Sadly there have been a lot of changes in pg8000, so it is not 
>>>>> backward compatible with the current custom version in web2py. 
>>>>>
>>>>> First, you need to delete the pg8000 folder in contrib, and put the 
>>>>> new pg8000 folder (the one with __init__.py) directly in the web2py top 
>>>>> level folder (at the same level as gluon).
>>>>> Note that the new pg8000 uses absolute imports that will not work if 
>>>>> pg8000 is in contrib folder (or it should be added to the PYTHONPATH)
>>>>>
>>>>> Second, you need to apply the attached patch to gluon/dal.py to:
>>>>>  * change the import (and add a missing __version__ attribute)
>>>>>  * change connection to pass individual parameters (dsn string is not 
>>>>> supported anymore)
>>>>>  * change after_connection set_client_encoding to execute SQL
>>>>>  * change server_version to _server_version
>>>>>
>>>>> I'll propose (again) to the pg8000 group the changes I've introduced 
>>>>> for web2py, so the latest version could be used as a direct drop-in 
>>>>> replacement for psycopg2
>>>>> IIRC, at some stage the author gave me commit access, but I didn't 
>>>>> have time to pull my changes and missed some discussions about the 
>>>>> project 
>>>>> internals.
>>>>>
>>>>> Best regards
>>>>>
>>>>>  
>>>>> Mariano Reingart
>>>>> http://www.sistemasagiles.com.ar
>>>>> http://reingart.blogspot.com
>>>>>
>>>>>
>>>>> On Tue, Feb 25, 2014 at 5:46 PM, Horst Horst <[email protected]>wrote:
>>>>>
>>>>>> I've tried the latest pg8000 as a drop-in replacement, but it seems 
>>>>>> web2py can't import it:
>>>>>>
>>>>>> <type 'exceptions.RuntimeError'> Failure to connect, tried 5 times: 
>>>>>> Traceback (most recent call last): File 
>>>>>> "/Users/sfx/dev/mdb/web2py.app/Contents/Resources/gluon/dal.py", line 
>>>>>> 7766, 
>>>>>> in __init__ File 
>>>>>> "/Users/sfx/dev/mdb/web2py.app/Contents/Resources/gluon/dal.py", line 
>>>>>> 2756, 
>>>>>> in __init__ File 
>>>>>> "/Users/sfx/dev/mdb/web2py.app/Contents/Resources/gluon/dal.py", line 
>>>>>> 795, 
>>>>>> in find_driver RuntimeError: no driver available ('psycopg2', 'pg8000')
>>>>>>
>>>>>> I didn't step through it in the debugger, but the module's 
>>>>>> __init__.pyc got compiled, so I know web2py attempted an import.
>>>>>>
>>>>>> The latest pg8000/__init__.py contains a section which matches the 
>>>>>> former interface
>>>>>>
>>>>>> # For compatibility with 1.8
>>>>>> import pg8000 as dbapi
>>>>>> DBAPI = dbapi
>>>>>> pg8000_dbapi = DBAPI
>>>>>>
>>>>>> so I'd guess it's a minor problem, nonetheless I'm lost at this point.
>>>>>>
>>>>>>
>>>>>> On Monday, February 24, 2014 9:32:05 PM UTC+1, Mariano Reingart wrote:
>>>>>>
>>>>>>> You could try to update pg8000 from the official:
>>>>>>>
>>>>>>> https://github.com/mfenniak/pg8000
>>>>>>>
>>>>>>> Let us know if that works, so we could update the one distributed 
>>>>>>> with web2py
>>>>>>> The one currently distributed in contrib is an older version with 
>>>>>>> custom patches (as it was not being mantained at the time it was 
>>>>>>> included 
>>>>>>> to web2py), but now the official site has updates that could help you 
>>>>>>> in 
>>>>>>> this case.
>>>>>>>
>>>>>>> Best regards
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Mariano Reingart
>>>>>>> http://www.sistemasagiles.com.ar
>>>>>>> http://reingart.blogspot.com
>>>>>>>
>>>>>>>
>>>>>>> On Mon, Feb 24, 2014 at 10:18 AM, Horst Horst <[email protected]>wrote:
>>>>>>>
>>>>>>>>  I'm getting a:
>>>>>>>>
>>>>>>>>   <class 'gluon.contrib.pg8000.errors.NotSupportedError'> type oid 
>>>>>>>> 114 not mapped to py type
>>>>>>>>
>>>>>>>> I'm wondering what's the best thing to do now? Currently I'm 
>>>>>>>> considering:
>>>>>>>>
>>>>>>>> - using TEXT instead. But my former JSON strings are then enclosed 
>>>>>>>> by "|" which leads to new errors
>>>>>>>>
>>>>>>>> - updating gp8000 (there seems to be a newer version, but the 
>>>>>>>> version numbering is confusing)
>>>>>>>>
>>>>>>>> - using psycopg2. How can I install this into an Mac OS standalone 
>>>>>>>> version of web2py?
>>>>>>>>
>>>>>>>>  -- 
>>>>>>>> Resources:
>>>>>>>> - http://web2py.com
>>>>>>>> - http://web2py.com/book (Documentation)
>>>>>>>> - http://github.com/web2py/web2py (Source code)
>>>>>>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>>>>>>> --- 
>>>>>>>> You received this message because you are subscribed to the Google 
>>>>>>>> Groups "web2py-users" group.
>>>>>>>> To unsubscribe from this group and stop receiving emails from it, 
>>>>>>>> send an email to [email protected].
>>>>>>>>
>>>>>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>>>>>
>>>>>>>
>>>>>>>  -- 
>>>>>> Resources:
>>>>>> - http://web2py.com
>>>>>> - http://web2py.com/book (Documentation)
>>>>>> - http://github.com/web2py/web2py (Source code)
>>>>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>>>>> --- 
>>>>>> You received this message because you are subscribed to the Google 
>>>>>> Groups "web2py-users" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it, 
>>>>>> send an email to [email protected].
>>>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>>>
>>>>>
>>>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to