Re: [ZODB-Dev] ZODB viewer script on ActiveState Python Cookbook

2005-04-08 Thread Chris Cioffi
See inline replies
On Apr 8, 2005 2:23 PM, Tim Peters <[EMAIL PROTECTED]> wrote:
[Chris Cioffi]> Just an FYI to all that I uploaded my first pass at a script for viewing> a ZODB data file.  This is a trivial implementation and probably need> some work, especially wrt accessing a ZODB via ZEO.It's a very cool thing about ZEO that normally all you need to change is oneline, from opening a FileStorage to opening a ClientStorage.  The onlycomplication then is parsing the ZEO server address (which may be ahost:port pair, or a Unix domain socket).  Maybe you could incorporateZConfig to make that "easy" .
 
I've been going over the ZEO docs and it looks pretty cool.  In fact it would solve a few minor issues I'm having with one of my apps.  My concern, however, is that my main app is *very* write intensive when it's running.  Methinks a little benchmarking is in order...
 
> This script uses wxPython so it's probably a bit oriented towards> Windows, I'll address that once my Mac Mini comes in. :-)Hmm.  I'm running on Windows, but don't have wxPython installed.  Tk is thecommon denominator across platforms; people can legitimately argue aboutwhether it's the _lowest_ common denominator.  I'd say you should usewhatever you like best.
 
I've tried Tkinker and really disliked it.  wxPython, while far from perfect feels much better...maybe doing something like pydoc with using the built in web server is in order. :)
 
> http
://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/409012>> Any feedback would be appreciated...One immediate suggestion:  there's a very long line in the code, startingwith:   self.db_layout_tree = wx.TreeCtrl(self.window_1_pane_1,[snip]The Python style guide:   http://www.python.org/peps/pep-0008.htmlrequests:   please limit all lines to a maximum of 79 charactersfor pragmatic reasons like this.
Ah, yes...maybe going over the output of wxGlade would be in order...even better would be to not use wxGlade but I'm lazy.Thanks for the input.
 
-- "I was born not knowing and have had only a little time to change that here and there." -- Richard Feynman___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev


RE: [ZODB-Dev] ZODB viewer script on ActiveState Python Cookbook

2005-04-08 Thread Tim Peters
[Chris Cioffi]
> Just an FYI to all that I uploaded my first pass at a script for viewing
> a ZODB data file.  This is a trivial implementation and probably need
> some work, especially wrt accessing a ZODB via ZEO.

It's a very cool thing about ZEO that normally all you need to change is one
line, from opening a FileStorage to opening a ClientStorage.  The only
complication then is parsing the ZEO server address (which may be a
host:port pair, or a Unix domain socket).  Maybe you could incorporate
ZConfig to make that "easy" .

> This script uses wxPython so it's probably a bit oriented towards
> Windows, I'll address that once my Mac Mini comes in. :-)

Hmm.  I'm running on Windows, but don't have wxPython installed.  Tk is the
common denominator across platforms; people can legitimately argue about
whether it's the _lowest_ common denominator.  I'd say you should use
whatever you like best.
 
> http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/409012
>
> Any feedback would be appreciated...

One immediate suggestion:  there's a very long line in the code, starting
with:

self.db_layout_tree = wx.TreeCtrl(self.window_1_pane_1,

ASPN reflows the text paragraphs to the width of that line too, so it's very
hard to read the Description and Discussion (unless I maximize the browser
window, I have to scroll left and right).  So rewrite that line, maybe like:

self.db_layout_tree = wx.TreeCtrl(self.window_1_pane_1, -1,
   style=wx.TR_HAS_BUTTONS |
 wx.TR_LINES_AT_ROOT |
 wx.TR_DEFAULT_STYLE |
 wx.SUNKEN_BORDER)

The Python style guide:

http://www.python.org/peps/pep-0008.html

requests:

please limit all lines to a maximum of 79 characters

for pragmatic reasons like this.

___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev