[Zope3-Users] Zope 3 UML Model / Architecture

2006-12-18 Thread Dennis Schulz

I am looking for examples of Zope 3 UML Diagrams / Architecture.
I would be especially interested  in widget / view rendering. (maybe 
even formlib) but also basic architecture.



Dennis

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] readline() takes exactly 1 argument

2006-12-18 Thread George Wright


Trying to get started on Zope3 but frustrated by a couple of barriers:

Barrier 1.
 Added a folder. Added a ZPT Page (As in Zope3 Developer's Book page  
12).

Then get system error message:
Traceback (most recent call last):
  Module zope.publisher.publish, line 126, in publish
request.processInputs()
  Module zope.publisher.browser, line 263, in processInputs
fs = FieldStorage(fp=fp, environ=self._environ,  
keep_blank_values=1)

  Module cgi, line 530, in __init__
self.read_multi(environ, keep_blank_values, strict_parsing)
  Module cgi, line 650, in read_multi
environ, keep_blank_values, strict_parsing)
  Module cgi, line 532, in __init__
self.read_single()
  Module cgi, line 665, in read_single
self.read_lines()
  Module cgi, line 687, in read_lines
self.read_lines_to_outerboundary()
  Module cgi, line 715, in read_lines_to_outerboundary
line = self.fp.readline(116)
TypeError: readline() takes exactly 1 argument (2 given)

I did a search of archives and found references to a patch of http.py  
and tales of success in solving the same problem:


Yes. Apply this patch to the zope3-sources:

/http.py
--- src/zope/publisher/http.py.old 2006-10-04 15:11:04.0 +0200
+++ src/zope/publisher/http.py  2006-10-04 15:11:04.0 +0200
@@ -205,7 +205,7 @@
 return data

 def readline(self,size=None):
-data = self.stream.readline(size)
+data = self.stream.readline()
 self.cacheStream.write(data)
 return data

BUT I'm not sure what to do with it!  What do the little - and + in  
front of the data =  lines mean?  And the @@ -205,7 +205,7 @@ ?


Just which http.py is to be patched?
~/Zope-3.3.0/build/lib.macosx-10.3-fat-2.4/zope/publisher/http.py
OR
~/Zope-3.3.0/build/lib.darwin-8.8.0-Power_Macintosh-2.4/zope/ 
publisher/http.py

OR ?

Maybe this problem has been fixed in a later version?

Barrier 2:
Should I be able to call zope from within terminal?
I can get interface ( probably because it is part of my twisted  
installation which is OK)

But I can't get other zope stuff.

george-g5:~ georgewright$ python
Python 2.4.4 (#1, Oct 18 2006, 10:34:39)
[GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin
Type help, copyright, credits or license for more information.
 from zope import interface
 from zope import schema
Traceback (most recent call last):
  File stdin, line 1, in ?
ImportError: cannot import name schema
 from zope import component
Traceback (most recent call last):
  File stdin, line 1, in ?
ImportError: cannot import name component


Seems like there is a $PATH problem or $PYTHONPATH?

Lots of other questions of course but maybe I will answer them for  
myself if I can get over these barriers!


Thanks

George Wright
http://users.bigpond.net.au/George.Wright/
http://www.labyrinth.net.au/~gwright



___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] readline() takes exactly 1 argument

2006-12-18 Thread Tom Dossis
George Wright wrote:
 Apply this patch to the zope3-sources:
 
 /http.py
 --- src/zope/publisher/http.py.old 2006-10-04 15:11:04.0 +0200
 +++ src/zope/publisher/http.py  2006-10-04 15:11:04.0 +0200
 @@ -205,7 +205,7 @@
  return data
 
  def readline(self,size=None):
 -data = self.stream.readline(size)
 +data = self.stream.readline()
  self.cacheStream.write(data)
  return data
 
 BUT I'm not sure what to do with it!  What do the little - and + in
 front of the data =  lines mean?  And the @@ -205,7 +205,7 @@ ?

Remove the '-' line, replace it with the '+' line.

 
 Just which http.py is to be patched?
 ~/Zope-3.3.0/build/lib.macosx-10.3-fat-2.4/zope/publisher/http.py
 OR
 ~/Zope-3.3.0/build/lib.darwin-8.8.0-Power_Macintosh-2.4/zope/publisher/http.py
 OR ?

Both if need be - but definitely in your runtime path.

 Should I be able to call zope from within terminal?
 I can get interface ( probably because it is part of my twisted
 installation which is OK)
 But I can't get other zope stuff.

cd to your zope INSTANCE_HOME, then you can invoke the python
interpreter with either of:

  ./bin/zopectl debug
or
  ./bin/debugzope

This will add zope (and $INSTANCE_HOME/lib/python) to your python path
and process all the zcml files.  It will also add 'app' to your python
session...

 app
zope.app.debug.debug.Debugger object at 0xb741010c
 app.root()
zope.app.folder.folder.Folder object at 0xb4fe706c
 list(app.root())
[u'Folder1', u'Folder2']

 from zope import schema
 dir(schema)
['ASCII', 'ASCIILine', 'Bool', 'Bytes', 'BytesLine', 'Choice',
'Container', 'Date', 'Datetime', 'Dict', 'DottedName', 'Field', 'Float',
'FrozenSet', 'Id', 'Int', 'InterfaceField', 'Iterable', 'List',
'MinMaxLen', 'Object', 'Orderable', 'Password', 'Set', 'SourceText',
'Text', 'TextLine', 'Timedelta', 'Tuple', 'URI', 'ValidationError',
'__builtins__', '__doc__', '__file__', '__name__', '__path__',
'_bootstrapfields', '_bootstrapinterfaces', '_field', '_schema',
'accessors', 'fieldproperty', 'getFieldNames', 'getFieldNamesInOrder',
'getFields', 'getFieldsInOrder', 'interfaces', 'vocabulary']


___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Re: zope 3.3 on windows can't create pages

2006-12-18 Thread Robert Hicks

Dominique Lederer wrote:

Anton schrieb:

Adam Groszer wrote:


Hello Anton,

That's a small incompatibility between python 2.4.4 and Zope 3.3.
You can use python 2.4.3 to work around that.
The fix for Zope is there but only in the svn yet.

Hi Adam,


Do you have any hint what file is affected
(if its only one or two lines to tweak it would
be faster than to reinstall 2.4.3)

If its a whole bunch of files, ... then of courxe ...
forget it :-)


Anton


take a look at
http://mail.zope.org/pipermail/zope3-users/2006-October/004742.html
and
http://www.zope.org/Collectors/Zope3-dev/535

cheers Dominique


Any ideas when a 2.4.4 version will be out?

Robert

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] readline() takes exactly 1 argument

2006-12-18 Thread Christian Theune
Hi,

George Wright wrote:
 Trying to get started on Zope3 but frustrated by a couple of barriers:
 
 Barrier 1.
   Added a folder. Added a ZPT Page (As in Zope3 Developer's Book page  
 12).
 Then get system error message:
 Traceback (most recent call last):
Module zope.publisher.publish, line 126, in publish
  request.processInputs()
Module zope.publisher.browser, line 263, in processInputs
  fs = FieldStorage(fp=fp, environ=self._environ,  
 keep_blank_values=1)
Module cgi, line 530, in __init__
  self.read_multi(environ, keep_blank_values, strict_parsing)
Module cgi, line 650, in read_multi
  environ, keep_blank_values, strict_parsing)
Module cgi, line 532, in __init__
  self.read_single()
Module cgi, line 665, in read_single
  self.read_lines()
Module cgi, line 687, in read_lines
  self.read_lines_to_outerboundary()
Module cgi, line 715, in read_lines_to_outerboundary
  line = self.fp.readline(116)
 TypeError: readline() takes exactly 1 argument (2 given)

This looks like a known incompatibility with Python 2.4.4. (If you're
interested in the details, see http://www.zope.org/Collectors/Zope3-dev/535)

 I did a search of archives and found references to a patch of http.py  
 and tales of success in solving the same problem:
 
 Yes. Apply this patch to the zope3-sources:
 
 /http.py
 --- src/zope/publisher/http.py.old 2006-10-04 15:11:04.0 +0200
 +++ src/zope/publisher/http.py  2006-10-04 15:11:04.0 +0200
 @@ -205,7 +205,7 @@
   return data
 
   def readline(self,size=None):
 -data = self.stream.readline(size)
 +data = self.stream.readline()
   self.cacheStream.write(data)
   return data

This is a standard patch format and there is a utility that can apply
this patch for you automatically. The patch is made for a checkout and
maybe also works on the source distribution for Zope 3.3

You should be able to store that patch in a file, e.g. called
'patchname.patch' and then run 'patch -p0  patchname.patch' in your
terminal. (I guess MacOS X comes with patch by default.)

Watch out for messages saying Hunk X out of X FAILED though.

Then reinstall your Zope server using make install, that should get your
installation directory updated with the right file.

 BUT I'm not sure what to do with it!  What do the little - and + in  
 front of the data =  lines mean?  And the @@ -205,7 +205,7 @@ ?
 
 Just which http.py is to be patched?
 ~/Zope-3.3.0/build/lib.macosx-10.3-fat-2.4/zope/publisher/http.py
 OR
 ~/Zope-3.3.0/build/lib.darwin-8.8.0-Power_Macintosh-2.4/zope/ 
 publisher/http.py
 OR ?

This looks like you did 'make' in your Zope-3.3.0 directory multiple
times on different versions of your operating system. Or this is an
idiom specific to Python on Mac OS X.

 Maybe this problem has been fixed in a later version?

It's not yet fixed finally, but if you watch the bug that I posted
above, you should be able to

The bugfix release should be available in early Januar 07.

Christian

-- 
gocept gmbh  co. kg - forsterstraße 29 - 06112 halle/saale - germany
www.gocept.com - [EMAIL PROTECTED] - phone +49 345 122 9889 7 -
fax +49 345 122 9889 1 - zope and plone consulting and development




signature.asc
Description: OpenPGP digital signature
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Re: zope 3.3 on windows can't create pages

2006-12-18 Thread Christian Theune
Hi,

Robert Hicks wrote:
 Any ideas when a 2.4.4 version will be out?

That will be Zope 3.3.1 and that should happen until early January 07.

Christian

-- 
gocept gmbh  co. kg - forsterstraße 29 - 06112 halle/saale - germany
www.gocept.com - [EMAIL PROTECTED] - phone +49 345 122 9889 7 -
fax +49 345 122 9889 1 - zope and plone consulting and development




signature.asc
Description: OpenPGP digital signature
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Periodically refresh RSS feeds

2006-12-18 Thread Christian Theune
Hi,

Florian Lindner wrote:
 Hello,
 I have the following situation:
 
 An object represents an RSS feed. It should be updated like every 20 minutes. 
 If there is something new a Jabber message should be send out.
 
 Currently I have it implemented with an scheduler loop that emits an 
 refreshRSSFeed event evey 20 minutes. My problem is that a handler for an 
 event must be a static function, but I want a handler function to be called 
 as a member of every instantiated RSS feed object.
 
 Another idea I have:
 Implement an utility where the RSS feeds could register a function that is 
 called every 20 minutes.
 Another way would be that this utility takes an URL and monitors the URL for 
 changes and only notifies the RSS Feed object in case of a change.

 How would you do that?

So there's two problems here: scheduling and notifying persistent
objects about an event.

I don't have a good idea about the scheduling right now, except the hint
that using a 'zopectl run' script might be worthwhile.  I'm not sure
what a 'scheduler function is'.

About notifying persistent objects: There is a method
'getAllUtilitiesRegisteredFor(interface)' which might help you. Have a
look at zope/app/catalog/catalog.py beginning from line 150
(indexDocSubscriber) how the catalog handles events and dispatches them
to multiple catalogs. I think this pretty much matches your use case if
you make each RSS feed a (named) utility.

Of course you could also have a utility that maintains references to all
RSS feed objects and simply loops over them and calls a method for
refreshing.

Christian

-- 
gocept gmbh  co. kg - forsterstraße 29 - 06112 halle/saale - germany
www.gocept.com - [EMAIL PROTECTED] - phone +49 345 122 9889 7 -
fax +49 345 122 9889 1 - zope and plone consulting and development




signature.asc
Description: OpenPGP digital signature
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users