[Repoze-dev] [issue144] Small typo on Unit and Integration Testing chapter

2010-05-03 Thread Nuno Teixeira

New submission from Nuno Teixeira tei...@gmail.com:

Index: docs/narr/unittesting.rst

===
--- docs/narr/unittesting.rst   (revision 9323)
+++ docs/narr/unittesting.rst   (working copy)
@@ -115,7 +115,7 @@
 of a :term:`Configurator`, including its ``begin`` and ``end``
 methods.
 
-If you also want to make :func:`repoze.bfg.get_current_registry`
+If you also want to make :func:`repoze.bfg.get_current_request`
 return something other than ``None`` during the course of a single
 test, you can pass a :term:`request` object into the

--
messages: 403
nosy: nteixeira
priority: bug
status: unread
title: Small typo on Unit and Integration Testing chapter
topic: bfg book

__
Repoze Bugs b...@bugs.repoze.org
http://bugs.repoze.org/issue144
__
___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev


Re: [Repoze-dev] Folder event subscriber not called

2010-05-03 Thread Chris McDonough
On Mon, 2010-05-03 at 23:33 -0400, Chris McDonough wrote:
 On Mon, 2010-05-03 at 12:55 -0700, Sam Brauer wrote:
  Hi there!  I'm a long-time Zope 2 user finally trying to do a demo project 
  with Repoze.bfg.  
  First
  off, congratulations to everyone developing Repoze!  You've really
  cherry picked the best concepts from Zope and packaged them in a lean
  modern framework.
  
  My demo project was going along very well
  until I tried to wire up some subscribers for repoze.folder events; my
  subscriber callbacks don't seem to be firing.  After trying a few days
  to figure out the problem, I think I need to ask for help.  I've tried
  to come up with a small example to demonstrate the problem, and I'd be
  very grateful for any help.  I feel like I'm missing something that
  should be obvious.
  
 
 Hi Sam,
 
 The events sent by repoze.folder are object events, which are events
 dispatched based on *two* interfaces (the context interface and the
 event interface).  Here's an example from KARL:
 
   subscriber
   for=repoze.lemonade.interfaces.IContent
repoze.folder.interfaces.IObjectAddedEvent
   handler=.subscribers.index_content/
 
 Hopefully this helps, 

Sorry, I should have also provided the subscribers.index_content
function so you could see its argument list:

def index_content(obj, event):
 Index content (an IObjectAddedEvent subscriber) 
catalog = find_catalog(obj)
if catalog is not None:
for node in postorder(obj):
if is_content(obj):
path = model_path(node)
docid = getattr(node, 'docid', None)
if docid is None:
docid = node.docid = catalog.document_map.add(path)
else:
catalog.document_map.add(path, docid)
catalog.index_doc(docid, node)


___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev