[Zope3-dev] Re: Bare excepts in z3c.zalchemy

2007-03-03 Thread Jürgen Kartnaller



Philipp von Weitershausen wrote:

For the lack of a better mailinglist, I'm posting this to zope3-dev:

z3c.zalchemy is pretty cool, but the tons of bare except clauses make me 
a bit uneasy. When I see them, I wonder what this code is expecting to 
fail and why. Plus, there are no comments as to why a try/except was 
used in the first place.


I would offer my help if I knew enough about SQLAlchemy and what kind of 
things can go wrong in those cases. Either way, I'd feel better using 
and recommending zalchemy if it didn't have those bare except clauses...





Hi Philip.

datamanager.py: 2 try/except
They are there because it is possible that a table already exists when 
trying to create it or doesn't exist when trying to delete it.
As I remember when I wrote this I couldn't find a better way, but I'm 
there is a better way in the latest version of sqlalchemy.


container.py: 2 try/except
get speaks for itself, it think!
__len__ contains it to be able to view the container even if there is no 
database connection. Otherwise if the database connection is lost you 
even can not view the container in zmi.


So tons == 4 :)

Jürgen

___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] Re: Bare excepts in z3c.zalchemy

2007-03-03 Thread Jürgen Kartnaller



Philipp von Weitershausen wrote:

Jürgen Kartnaller wrote:

datamanager.py: 2 try/except
They are there because it is possible that a table already exists when 
trying to create it or doesn't exist when trying to delete it.
As I remember when I wrote this I couldn't find a better way, but I'm 
there is a better way in the latest version of sqlalchemy.


Good to know.


container.py: 2 try/except
get speaks for itself, it think!


Yes, those aren't bare excepts. Those make sense to me :)

__len__ contains it to be able to view the container even if there is 
no database connection. Otherwise if the database connection is lost 
you even can not view the container in zmi.


So tons == 4 :)


Okay, okay, I was exaggerating :). But there are some bare excepts in 
the tests as well:


  $ grep -nH -rI except: *
  datamanager.py:153:except:
  datamanager.py:162:except:


Maybe one can figure out which exception we need to catch here.


  testing/__init__.py:31:except:
  tests/test_zalchemy.py:35:except:
  tests/test_zalchemy.py:39:except:
  tests/test_zalchemy.py:43:except:


Yes these stupid except's are because of windows :(
I wrote the first version on windows and had the problem that windows 
didn't let me delete the files.


Jürgen

___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] Participation on the Python Web-SIG

2007-03-03 Thread Jim Fulton


I encourage people interested in Zope development to subscribe to the  
Python Web-SIG mailing list:


  http://mail.python.org/mailman/listinfo/web-sig

I think we should be seeking to collaborate with the wider Python Web  
development community.


Also, often when I discuss things on that mailing list, I feel like  
I'm the only Zope person present.  I'd love to have more support.  
Also, there are a diversity of points of view in the Zope community  
and I shouldn't be the only one representing us.


Jim

--
Jim Fulton  mailto:[EMAIL PROTECTED]Python 
Powered!
CTO (540) 361-1714  
http://www.python.org
Zope Corporationhttp://www.zope.com http://www.zope.org



___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] Re: Bare excepts in z3c.zalchemy

2007-03-03 Thread Chris Withers

Jürgen Kartnaller wrote:

Yes these stupid except's are because of windows :(
I wrote the first version on windows and had the problem that windows 
didn't let me delete the files.


It is possible to do this right, I've had to in the past...

The fact that you get an error there is an indication that something in 
your tests still has a file open in some way, you should fix that ;-)


Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] Re: Bare excepts in z3c.zalchemy

2007-03-03 Thread Jürgen Kartnaller



Chris Withers wrote:

Jürgen Kartnaller wrote:

Yes these stupid except's are because of windows :(
I wrote the first version on windows and had the problem that windows 
didn't let me delete the files.


It is possible to do this right, I've had to in the past...

The fact that you get an error there is an indication that something in 
your tests still has a file open in some way, you should fix that ;-)


The something was/is sqlite !

Jürgen

___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



RE: [Zope3-dev] z3c.javascript eggs now available

2007-03-03 Thread Roger Ineichen
Hi Paul

 Subject: Re: [Zope3-dev] z3c.javascript eggs now available
[...]

Do whatever you like to do within the javascript sources in 
the z3c.javascript packages.
Right now it's not useable because the javascript versions 
are not documented the package are using.

 Finally, the current layout of the z3c.javascript repository 
 makes doing eggs for individual subpackages (dojo, mochikit, 
 etc.) a pain and I don't think anyone wants to download a 
 single 14mb egg for the entire z3c.javascript package.  Would 
 it make sense to put
 z3c.javascript.* subpackages into the root of the zope repository?
 
 Also, I'm about to send in a zope contributor agreement form 
 so that my packaging files can make it into the zope repository.

Is it not possible to build eggs for sub packages of 
z3c.javascript? Must they be top level packages?

If so, that's a problem for other packages in z3c too?

Regards
Roger Ineichen

___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] Re: z3c.javascript eggs now available

2007-03-03 Thread Philipp von Weitershausen

Roger Ineichen wrote:
Finally, the current layout of the z3c.javascript repository 
makes doing eggs for individual subpackages (dojo, mochikit, 
etc.) a pain and I don't think anyone wants to download a 
single 14mb egg for the entire z3c.javascript package.  Would 
it make sense to put

z3c.javascript.* subpackages into the root of the zope repository?

Also, I'm about to send in a zope contributor agreement form 
so that my packaging files can make it into the zope repository.


Is it not possible to build eggs for sub packages of 
z3c.javascript? Must they be top level packages?


If so, that's a problem for other packages in z3c too?


I wonder why z3c.javascript and z3c.widget contain so many subpackages. 
Having a flatter package structure would have been nicer and, I guess, 
easier for individual eggification.


Paul has a point with the 14 MB egg. Also, I often find myself only 
needing the DateTime widget from z3c.widget, but none of the rest. I 
wish there simply was z3c.datetimewidget...



--
http://worldcookery.com -- Professional Zope documentation and training
Next Zope 3 training at Camp5: http://trizpug.org/boot-camp/camp5
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com