Re: Trying to use PyDO under cygwin

Jonathan Kelly <[email protected]>
Newsgroups gmane.comp.web.skunkweb
Message-ID <[email protected]>
Jacob Smullyan wrote:
> I don't think the error Jonathan is reporting is driver related.
> 
> Jonathan, could you please:
> 
>   1. Download either the latest CVS version of PyDO, not the PyDO tarball,
>      or PyDO as included in the latest SkunkWeb release.  I think
>      the bug you reported is fixed, and arose because of a change in a later
>      Python 2.2 release.
>   2. Try again, and if you get an error message, mail the actual traceback to
>      the list rather than an anecdotal description, which I can't do anything
>      about!

OK. I downloaded the Skunkweb release 3.4b5 and extracted PyDO from that 
  into my site-packages.

I saw there was a psycopg connection thingy, so that's a good thing, 
though it wasn't clear as to how to use it. I couldn't find any explicit 
pointers into how to actually use it, so I do my usual thing, and guess.

I dummied up a script from the example just to see if I could get things 
working but ... it crashed saying

Traceback (most recent call last):
   File "H:\cygwin\home\JK\testone.py", line 24, in ?
     from PyDO import *
   File "D:\PYTHON23\lib\site-packages\PyDO\__init__.py", line 8, in ?
     from PyDO import *
   File "D:\PYTHON23\lib\site-packages\PyDO\PyDO.py", line 11, in ?
     from static import *
  ImportError: No module named static

OK. I had noted that there was a PyDO.py and PyDO2.py and that the 
comments in PyDO2.py mentioned something about doing away with static, 
so I saved PyDO.py and moved PyDO2.py onto PyDO.py and tried again.

Traceback (most recent call last):
   File "H:\cygwin\home\Jonathan Kelly\testone.py", line 24, in ?
     from PyDO import *
   File "D:\PYTHON23\lib\site-packages\PyDO\__init__.py", line 9, in ?
     del string, types
NameError: name 'string' is not defined

Hmm. Had a look, and tried the simple thing of adding import string to 
the PyDO.py (which was PyDO2.py) and tried again.

TaDa! No crash. Now to try actually doing something.

Hmm ... more than an two hours later, I finally have it working.

psycopgconn.py is full of bugs. Syntax errors even. I've fixed a few 
things, but have no idea what is supposed to be happening, as this stuff 
"seems" beyond my Python skills, which I consider meager. EG I found this

     def convertResultRows(self, colnames, attributes, rows):
          newresult = []
          for row in rows:
              d = {}
              for item, desc in map(None, row, colnames):
                  #do dbtype->python type conversions here

                  # I added this line as the following line
                  # was raising an attribute error
                  desc = desc.upper()

                  a = attributes[desc].upper()
                  <snip>


I'm happy to help and feed stuff back, but it will need some supervision 
as I'm very newb to python and postgresql, but not an idiot though.

All I really wanted to do is find out if PyDO was nicer than raw SQL.

Cheers,
Jonathan.

> Thanks!
> 
> Jacob S.
> 
> 
> 
> On Wed, Aug 18, 2004 at 11:37:22AM -0400, Christopher Petrilli wrote:
> 
>>On Wed, 18 Aug 2004 21:27:33 +1000, Jonathan Kelly <[email protected]> wrote:
>>
>>>
>>>Jonathan Kelly wrote:
>>>
>>>
>>>>Hi,
>>>>
>>>>I've been trying to get PyDO working under cygwin.
>>>
>>>Actually I should rephrase that. I'm trying to run PyDO under windows,
>>>connected to a postgresql database running under cygwin.
>>
>>You might consider trying the beta 8.0 release, as it runs natively
>>under Windows, even as a service correctly.  This might be part of
>>your problem.
>>
>>Chris
>>-- 
>>| Christopher Petrilli
>>| [email protected]
>>
>>
>>-------------------------------------------------------
>>SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
>>100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
>>Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
>>http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
>>_______________________________________________
>>Skunkweb-list mailing list
>>[email protected]
>>https://lists.sourceforge.net/lists/listinfo/skunkweb-list
>>
> 
> 



-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.