[Zope-dev] How to use UserTrack product?

2008-09-09 Thread Rupesh P Raj
Hi,

I am very newbee to Zope. In my Zope application I want to integrate
UserTrack product (we dont use plone). I placed the UserTrack folder inside
the Products directory, and created an instance of UserTrack inside some of
the other zope products, as follows:

u = UserTrack()
logger(str(u.listUserActivities()))

But the list is coming as empty. I think the place where I have initialised
the UserTrack instance is wrong.

In the Readme file which comes along with UserTrack says that, UserTrack
lists the currently active authenticated users that are logged into zope and
accesses an object below the folder where the UserTrack instance resides. So
I guess I need to write initialize in some of the ZMI folder object, but
which one?. Can anyone please help me.

Thanks
Roopesh
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] SVN: z3c.pt/trunk/TODO.txt

2008-09-09 Thread Malthe Borch
Chris McDonough wrote:
 Log message for revision 90974:
 Added: z3c.pt/trunk/TODO.txt
 ===
 --- z3c.pt/trunk/TODO.txt (rev 0)
 +++ z3c.pt/trunk/TODO.txt 2008-09-09 00:03:08 UTC (rev 90974)
 @@ -0,0 +1,4 @@
 +- Make e.g. tal:block tal:foo / and metal:foo metal:define-macro/ etc.
 +  work

Are we sure we want this? It's (afaik) not correct XML; but maybe an 
exception should be raised, rather than no interpretation.

\malthe

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] SVN: z3c.pt/trunk/TODO.txt

2008-09-09 Thread Stephan Richter
On Tuesday 09 September 2008, Malthe Borch wrote:
 If the element belongs to some namespace, then attributes from this
 namespace should be native to it. But I couldn't find any
 documentation to support that this is a strict requirement. Perhaps it
 should be allowed, then.

It's not strict. It's a shortcut. 

Regards,
Stephan
-- 
Stephan Richter
Web Software Design, Development and Training
Google me. Zope Stephan Richter
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] SVN: z3c.pt/trunk/TODO.txt

2008-09-09 Thread Malthe Borch
2008/9/9 Stephan Richter [EMAIL PROTECTED]:
 It's not strict. It's a shortcut.

No it's other way around.

tal:block for= / is the short-cut for tal:block tal:for= /.

Previously only the short-cut was allowed; this has been changed in
the most recent release of z3c.pt.

\malthe
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] zope.component: calling an Interface and calling queryAdapter give differing results

2008-09-09 Thread Dieter Maurer
Chris Withers wrote at 2008-9-8 18:34 +0100:
 ...
 There's the backward-compatibility issue, which is a showstopper.
 There's plenty of code that does this:
 
 adapter = package.interfaces.IFoo(object, None)
 
 Changing the signature as you describe would break all code that does this.

How about a new major revision of zope.interface then?

I fear that would be a bit drastic -- for a mostly cosmetic change.

But interfaces might grow an additional method, e.g. adapt,
which could get the new signature.

The syntax would be a bit more cumbersome -- but on the other
hand, it would be more explicit :-)



-- 
Dieter
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] zope.component: calling an Interface and calling queryAdapter give differing results

2008-09-09 Thread Fred Drake
On Tue, Sep 9, 2008 at 2:37 PM, Dieter Maurer [EMAIL PROTECTED] wrote:
 The syntax would be a bit more cumbersome -- but on the other
 hand, it would be more explicit :-)

Seems to me zope.component.getMultiAdapter(...) is sufficient as-is,
and shares the benefit of explicitness.

That's sufficient for me.


 -Fred

-- 
Fred L. Drake, Jr. fdrake at gmail.com
Chaos is the score upon which reality is written. --Henry Miller
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] How to use UserTrack product?

2008-09-09 Thread Dieter Maurer
Rupesh P Raj wrote at 2008-9-9 13:41 +0530:
I am very newbee to Zope. In my Zope application I want to integrate
UserTrack product (we dont use plone). I placed the UserTrack folder inside
the Products directory, and created an instance of UserTrack inside some of
the other zope products, as follows:

u = UserTrack()
logger(str(u.listUserActivities()))

But the list is coming as empty. I think the place where I have initialised
the UserTrack instance is wrong.

In the Readme file which comes along with UserTrack says that, UserTrack
lists the currently active authenticated users that are logged into zope and
accesses an object below the folder where the UserTrack instance resides. So
I guess I need to write initialize in some of the ZMI folder object, but
which one?. Can anyone please help me.

I do not know UserTrack and how it works.

However, the README tells you, that UserTrack must reside
in a folder. This means that it must be integrated into the Zope
site hierarchy.


Usually, you put objects into a folder in the ZMI via the so
called add list. This is the selection field to the left
of the Add button in the Contents tab of folder like objects.


You can also do this programmatically.
The idiom is

destination.manage_addProduct[defining_product].constructor(args)

Here defining_product is the product that defines the new object's
class, constructor is the function that create the object
and args are the arguments the constructor needs (usually
the id of the object to be created, optionally a title).


An example would be:

   destination.manage_addProduct['OFSP'].manage_addFile(id, content)


-- 
Dieter
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] zope.component: calling an Interface and calling queryAdapter give differing results

2008-09-09 Thread Philipp von Weitershausen
El 9 Sep 2008, a las 20:37 , Dieter Maurer escribió:
 Chris Withers wrote at 2008-9-8 18:34 +0100:
 ...
 There's the backward-compatibility issue, which is a showstopper.
 There's plenty of code that does this:

adapter = package.interfaces.IFoo(object, None)

 Changing the signature as you describe would break all code that  
 does this.

 How about a new major revision of zope.interface then?

 I fear that would be a bit drastic -- for a mostly cosmetic change.

I agree.

 But interfaces might grow an additional method, e.g. adapt,
 which could get the new signature.

 The syntax would be a bit more cumbersome -- but on the other
 hand, it would be more explicit :-)

I don't think it would be too cumbersome. While IMHO elegant, the  
current syntax of calling an interface to adapt isn't actually self- 
explanatory. I've frequently observed people tripping over this,  
specially when you have an IFoo interface and a Foo class -- which is  
quite common --, then IFoo(obj) and Foo(obj) differ only by one  
character. With your suggestion, it would be IFoo.adapt(obj) vs.  
Foo(obj), making the difference quite obvious.

So overall I'm +1

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] zope.component: calling an Interface and calling queryAdapter give differing results

2008-09-09 Thread Shane Hathaway
Philipp von Weitershausen wrote:
 El 9 Sep 2008, a las 20:37 , Dieter Maurer escribió:
 But interfaces might grow an additional method, e.g. adapt,
 which could get the new signature.

 The syntax would be a bit more cumbersome -- but on the other
 hand, it would be more explicit :-)
 
 I don't think it would be too cumbersome. While IMHO elegant, the  
 current syntax of calling an interface to adapt isn't actually self- 
 explanatory. I've frequently observed people tripping over this,  
 specially when you have an IFoo interface and a Foo class -- which is  
 quite common --, then IFoo(obj) and Foo(obj) differ only by one  
 character. With your suggestion, it would be IFoo.adapt(obj) vs.  
 Foo(obj), making the difference quite obvious.
 
 So overall I'm +1

+1 from me as well on IFoo.adapt() with the signature Chris suggested. 
zope.component.getMultiAdapter() is only easy to remember if you're a 
die-hard Zope coder, while IFoo.adapt() seems more useful to the larger 
Python community.

Shane

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )