[Zope-dev] Re: SessionManager, BerkeleyDB, and license compatability

2000-10-13 Thread Stefane Fermigier

On Thu, Oct 12, 2000 at 12:00:07PM -0700, [EMAIL PROTECTED] wrote:
 From: Toby Dickenson [EMAIL PROTECTED]
 To: [EMAIL PROTECTED], [EMAIL PROTECTED]
 Cc: James Wilson  [EMAIL PROTECTED]
 Subject: [Zope-dev] SessionManager, BerkeleyDB, and license compatability
 Date: Thu, 12 Oct 2000 15:04:28 +0100
 Reply-To: [EMAIL PROTECTED]
 
 I understand from the SessionTracking wiki that this product may use
 BerkeleyDB
 
 http://www.zope.org/Wikis/DevSite/Projects/CoreSessionTracking/CurrentStatus
 
 The BerkeleyDB license at http://www.sleepycat.com/licensing.html
 indicates that it may only be distributed free of charge with software
 that is 'freely available and redistributable by others'.
 
 We are currently using Zope to develop an application that does not
 fall into this category. It would be a serious problem for us if
 Zope's core had a dependency on code with this type of license.

If I remember correctly some information I got on the Python newsgroups
long time ago, the Sleepycat people only care that Python, which is linked
to BerkeleyDB, is free. The free/commercial status of the application you will 
write in Python (including Zope and third party products) is not relevant to
them.

S.

-- 
Stéfane Fermigier, Tel: 06 63 04 12 77 (mobile).
www.portalux.com: le portail Linux / logiciel libre.
"Amazon: we patent the dot in .com"

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




Re: [Zope-dev] Xron fragility

2000-10-13 Thread Toby Dickenson

Yes, using Client.py was the easiest way to do that. The biggest problem
with Client.py is its dependency on HTTP. If your server is set up to
only accept HTTPS, then you can't use Xron -- not a desirable trade-off.

If security is the problem, you could configure the HTTP part to
listen only on a loopback interface. (yes, this is supported on NT and
windows 95 too)

We need another mechanism that achieves the same goal -- simulating the
environment of a request -- without going all the way back to the
socket.

I always thought the use of Client was very elegent. The performance
hit is negligible, and all the plausible alternatives need many more
lines of code.

Another advantage is that it promotes testability of the scheduled
events since it is easy (trivial) to reproduce the environment in
which they run when scheduled.

Toby Dickenson
[EMAIL PROTECTED]

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




[Zope-dev] More almost __call__ ;-)

2000-10-13 Thread Chris Withers

Jim Fulton wrote:
snip __call__ stuff

Okay, this is almost the same, but apparently not the same.

I have a Python Product Class, with a method, a_method, that gets called
from some of the Python Product's management screens (encapsulation is
good ;-)

This method needs several parameters from the namespace, so when it's
called I was hoping I wouldn't have to do something nasty and clunky
like:

dtml-var "a_method(param1,param2,param3)"

Given my recently acquired __call__ Zen, I thought 'No problem...' and
tried to define the method as follows:

isDocTemplate = 1

def a_method(self, ignored=None, md=None):

...with the hope I'd just be able to do dtml-var a_method and pluck
the stuff from md.

No dice.

md and ignored turn up as None from all the dtml-var a_method calls.
:-(

What am I doing wrong? How can I get access to the namespace in a method
of a class like this?

cheers,

Chris

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




Re: [Zope-dev] More almost __call__ ;-)

2000-10-13 Thread Toby Dickenson

On Fri, 13 Oct 2000 11:48:39 +0100, Chris Withers [EMAIL PROTECTED]
wrote:

I have a Python Product Class, with a method, a_method, that gets called
from some of the Python Product's management screens (encapsulation is
good ;-)

This method needs several parameters from the namespace, so when it's
called I was hoping I wouldn't have to do something nasty and clunky
like:

dtml-var "a_method(param1,param2,param3)"

Given my recently acquired __call__ Zen, I thought 'No problem...' and
tried to define the method as follows:

isDocTemplate = 1

def a_method(self, ignored=None, md=None):

...with the hope I'd just be able to do dtml-var a_method and pluck
the stuff from md.

No dice.

md and ignored turn up as None from all the dtml-var a_method calls.
:-(

What am I doing wrong? How can I get access to the namespace in a method
of a class like this?

You need to have the isDocTemplate=1 as an attribute of the method
object itself, not the class that contains the method.

You also need some extra voodoo if you want to call the method
directly from ZPublisher (by including the method name in a url). Here
a link to a wrapper that does it all

http://www.zope.org/Members/htrd/howto/FunctionTemplate

you would use

def a_method(self,md):
do_stuff_with(md['param1'],md['param2'])
a_method = FunctionTemplate(a_method)




Toby Dickenson
[EMAIL PROTECTED]

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




Re: [Zope-dev] More almost __call__ ;-)

2000-10-13 Thread Chris Withers

Toby Dickenson wrote:
 http://www.zope.org/Members/htrd/howto/FunctionTemplate
 
 you would use
 
 def a_method(self,md):
 do_stuff_with(md['param1'],md['param2'])
 a_method = FunctionTemplate(a_method)

That looks like it'll do the trick... I wonder if there's any way you
can role it up into a Product so that I don't need to have
FunctionTemplate.py in each folder of a product that needs to use it?

cheers,

Chris

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




RE: [Zope-dev] More almost __call__ ;-)

2000-10-13 Thread Toby Dickenson

 That looks like it'll do the trick... I wonder if there's any way you
 can role it up into a Product so that I don't need to have
 FunctionTemplate.py in each folder of a product that needs to use it?

Im working on a set of tools to aid my transition to a dtml-free Zope.
Eventually I will package them all as a whole.

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




Re: [Zope-dev] More almost __call__ ;-)

2000-10-13 Thread Chris Withers

Toby Dickenson wrote:
 
  That looks like it'll do the trick... I wonder if there's any way you
  can role it up into a Product so that I don't need to have
  FunctionTemplate.py in each folder of a product that needs to use it?
 
 Im working on a set of tools to aid my transition to a dtml-free Zope.
 Eventually I will package them all as a whole.

cartman voice

swt

Chris ;-)

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




Re: [Zope-dev] More almost __call__ ;-)

2000-10-13 Thread Chris Withers

Toby Dickenson wrote:
 http://www.zope.org/Members/htrd/howto/FunctionTemplate
 
 you would use
 
 def a_method(self,md):
 do_stuff_with(md['param1'],md['param2'])
 a_method = FunctionTemplate(a_method)

Okay, spoke too soon... when I do the above and then call the method
with:

dtml-var a_method

I get:

Error type: exceptions.AttributeError
Error value: __len__ 

Traceback (innermost last):
  File E:\Zope\2271B4~1.2\lib\python\ZPublisher\Publish.py, line 222, in
publish_module
  File E:\Zope\2271B4~1.2\lib\python\ZPublisher\Publish.py, line 187, in
publish
  File E:\Zope\2271B4~1.2\lib\python\Zope\__init__.py, line 221, in
zpublisher_exception_hook
(Object: testdefiner)
  File E:\Zope\2271B4~1.2\lib\python\ZPublisher\Publish.py, line 171, in
publish
  File E:\Zope\2271B4~1.2\lib\python\ZPublisher\mapply.py, line 160, in
mapply
(Object: index_html)
  File E:\Zope\2271B4~1.2\lib\python\ZPublisher\Publish.py, line 112, in
call_object
(Object: index_html)
  File E:\Zope\2271B4~1.2\lib\python\App\special_dtml.py, line 120, in
__call__
(Object: index_html)
(Info: E:\Zope\2.2.2\lib\python\Products\A_product\Form.dtml)
  File E:\Zope\2.2.1\lib\python\Products\ZDebug\DTMLLocator.py, line
103, in __call__
(Object: index_html)
  File E:\Zope\2271B4~1.2\lib\python\DocumentTemplate\DT_String.py, line
528, in __call__
(Object: index_html)
  File E:\Zope\2.2.1\lib\python\Products\ZDebug\DTMLDebug.py, line 288,
in debug_render_blocks
  File E:\Zope\2.2.1\lib\python\Products\ZDebug\DTMLDebug.py, line 286,
in debug_render_blocks
  File E:\Zope\2271B4~1.2\lib\python\DocumentTemplate\DT_In.py, line
691, in renderwob
(Object: _.range(1,11))
  File E:\Zope\2.2.1\lib\python\Products\ZDebug\DTMLDebug.py, line 288,
in debug_render_blocks
  File E:\Zope\2.2.1\lib\python\Products\ZDebug\DTMLDebug.py, line 286,
in debug_render_blocks
  File E:\Zope\2271B4~1.2\lib\python\DocumentTemplate\DT_Let.py, line
147, in render
(Object: row=sequence-item)
  File E:\Zope\2.2.1\lib\python\Products\ZDebug\DTMLDebug.py, line 242,
in debug_render_blocks
  File E:\Zope\2.2.1\lib\python\Products\ZDebug\DTMLDebug.py, line 221,
in debugException
  File E:\Zope\2.2.1\lib\python\Products\ZDebug\DTMLDebug.py, line 239,
in debug_render_blocks
  File E:\Zope\2.2.2\lib\python\Products\A_product\FunctionTemplate.py,
line 38, in __call__
AttributeError: (see above)

What's going on?

cheers,

Chris

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




Re: [Zope-dev] More almost __call__ ;-)

2000-10-13 Thread Chris Withers

Jim Fulton wrote:

 In any case, if you *just* want to get your function to be
 called from DTML (and your class is an extension class), you can give
 it the isDocTemp attribute like so:
 
   class MyClass( include some extension class ...):
 
 some_methodisDocTemp=1
 def some_method(self, ignored, md):

great :-) that did the trick, thanks...

I can't help but feel this woudl all be so much simpler if it was
documented somewhere for idiots like me :-S

cheers,

Chris

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




Re: [Zope-dev] More almost __call__ ;-)

2000-10-13 Thread Shane Hathaway

Jim Fulton wrote:
 
 Chris Withers wrote:
 
  Toby Dickenson wrote:
   http://www.zope.org/Members/htrd/howto/FunctionTemplate
  
   you would use
  
   def a_method(self,md):
   do_stuff_with(md['param1'],md['param2'])
   a_method = FunctionTemplate(a_method)
 
  That looks like it'll do the trick... I wonder if there's any way you
  can role it up into a Product so that I don't need to have
  FunctionTemplate.py in each folder of a product that needs to use it?
 
 Is it *really* the case that you often want to method to be called directly
 via the Web *and* and from DTML?  This doesn't seem right to me.

As I understand it, that's not the issue.  Chris wants to receive the
DTML namespace implicitly.

 In any case, if you *just* want to get your function to be
 called from DTML (and your class is an extension class), you can give
 it the isDocTemp attribute like so:
 
   class MyClass( include some extension class ...):
 
 some_methodisDocTemp=1
 def some_method(trueself, self, REQUEST, RESPONSE=None):
 

That's a good idea, I wish I'd thought of it. :-)

However, the new calling convention (__render_with_namespace__, or
something like that) might break "isDocTemp" code.

 Note that if you get called from the web, RESPONSE will
 not be none. This is a handy way to decide if you
 are called from the web or as a sub-template. Of course,
 someone could pass a non-None RESPONSE argument directly.

This convention is helpful but not at all documented, so products (ZWiki
is a good example) often break this convention.

Shane

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




Re: [Zope-dev] Thanks for the comments

2000-10-13 Thread Josh Zeidner


  WROX contacted me a while back saying they wanted to do a Zope book as 
well.  Does anyone know anything about this?

  -josh



Just thought we'd mention that we have gotten lots of great comments on
the Zope book so far, especially in the last week or so.  You're all
helping make it a better book and ensuring Zope's future.  if you've
felt in the past that you may not be technically proficient enough to
contribute to the technology of Zope, you can certainly contribute to
the documentation by catching our mistakes and making good observations
and asking good questions. It is really, really helping.  Keep it up,
cuz we're not done yet!

Thanks,

Michel and Amos

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


_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


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




Re: [Zope-dev] More almost __call__ ;-)

2000-10-13 Thread Jim Fulton

Shane Hathaway wrote:
 
 Jim Fulton wrote:
 
  Chris Withers wrote:
  
   Toby Dickenson wrote:
http://www.zope.org/Members/htrd/howto/FunctionTemplate
   
you would use
   
def a_method(self,md):
do_stuff_with(md['param1'],md['param2'])
a_method = FunctionTemplate(a_method)
  
   That looks like it'll do the trick... I wonder if there's any way you
   can role it up into a Product so that I don't need to have
   FunctionTemplate.py in each folder of a product that needs to use it?
 
  Is it *really* the case that you often want to method to be called directly
  via the Web *and* and from DTML?  This doesn't seem right to me.
 
 As I understand it, that's not the issue.  Chris wants to receive the
 DTML namespace implicitly.
 
  In any case, if you *just* want to get your function to be
  called from DTML (and your class is an extension class), you can give
  it the isDocTemp attribute like so:
 
class MyClass( include some extension class ...):
 
  some_methodisDocTemp=1
  def some_method(trueself, self, REQUEST, RESPONSE=None):
  
 
 That's a good idea, I wish I'd thought of it. :-)
 
 However, the new calling convention (__render_with_namespace__, or
 something like that) might break "isDocTemp" code.

I thought of that, but I don't think so. There are obviously 
enough people using the isDocTemp thing that we'll probably need to
keep supporting it.  The use of a separate render method won't be
convenient for iplementing simple methods. Not that that is necessarily
that critical.

  Note that if you get called from the web, RESPONSE will
  not be none. This is a handy way to decide if you
  are called from the web or as a sub-template. Of course,
  someone could pass a non-None RESPONSE argument directly.
 
 This convention is helpful but not at all documented, so products (ZWiki
 is a good example) often break this convention.

Which convention? The passing of arguments with names meaningful to
the publisher is certainly well documented.

Jim

--
Jim Fulton   mailto:[EMAIL PROTECTED]   Python Powered!
Technical Director   (888) 344-4332http://www.python.org  
Digital Creationshttp://www.digicool.com   http://www.zope.org

Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email
address may not be added to any commercial mail list with out my
permission.  Violation of my privacy with advertising or SPAM will
result in a suit for a MINIMUM of $500 damages/incident, $1500 for
repeats.

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




Re: [Zope-dev] Wrox Book

2000-10-13 Thread Brad Clements

On 13 Oct 2000, at 15:59, Chris Withers wrote:

 Josh Zeidner wrote:
  
WROX contacted me a while back saying they wanted to do a Zope book as
  well.  Does anyone know anything about this?
  
-josh
 
 Yeah, that project has just been pulled, I think ;-)

Pulled as in cancelled?

-Brad

p.s.  Anyone see my chapter on Embedding/Extending Python in the 
Wrox Professional Linux Programming book? looking for feedback 
(kudos, hatemail, etc)




Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com   AOL-IM: BKClements

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




Re: [Zope-dev] More almost __call__ ;-)

2000-10-13 Thread Shane Hathaway

Jim Fulton wrote:
 The fact that ZPublisher will pass it is documented.  Whether
 or not something else calls it is up to the something else.
 The method designer specified an interface that includes RESPONSE.
 If it requires RESPONSE, by not specifying a default, then it
 requires the clients to oass it. If the clients don't, then they
 are not satisfying the interface.  Are you saying that objects
 that require that RESPONSE is passed are broken because they don't
 sufficiently advertise the fact?

I'm saying that there are some methods which expect the RESPONSE to be
passed only when called by ZPublisher.  They expect RESPONSE to be
"None" when called as a subtemplate or otherwise.  The only problem is
that this convention is not enforced.

But we've strayed... :-)

Shane

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




[Zope-dev] WriteLocking Proposal Revisited. Again.

2000-10-13 Thread Jeffrey P Shell

WriteLocking http://dev.zope.org/Wikis/DevSite/Proposals/WriteLocking

Revisited and rewritten again after some internal discussions and a decision
to ensure that the proposed Write Locking for WebDAV behaves in a matter
that the clients (particularly the more popular ones) expect.  There's less
architectural discussion in this revision of the proposal, intentionally.

--jeffrey


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




[Zope-dev] Re: FW: [Support] [ZOPE Collector] Zope Bug entry: Ghost ZClasses

2000-10-13 Thread Shane Hathaway

Brian Lloyd wrote:
  A new bug entry was added with the following information:
 
  Title:  Ghost ZClasses
 
  At: http://classic.zope.org:8080/Collector/1676/sview
 
  Submitter:  lalo
 
  Email:  [EMAIL PROTECTED]
 
  Description:  Some ZClasses in a ZODB migrated from 2.1.6 did not
  handle the migration well. Their instances were reported as
  broken, till I removed the Product, when the instances started
  working (but with no icon, factory or constructor).

I would have to guess that the cause may be a product that was supplying
a base class wasn't installed.

  I tried flushing the cache, packing the database and restarting
  Zope, to no avail. Then I found there was a global registry for
  ZClasses; looks like somehow, when the classes were deleted, they
  didn't _unregister().
 
  I finally tired of not being able to create banners and manually
  removed the classes (via Python) from root()['ZGlobals']. Not
  that this is a fix, but it's something other people with the same
  problem can do if they're brave (insane?) enough.

This is actually expected behavior: if the ZClass itself is broken, Zope
can't even figure out what class ID it was supplying.  ZClasses break
when the base classes disappear.  At that point, there's no way to
unregister from ZGlobals.

This is a Hard Problem.  At the moment the only way I see fixing it is a
big change to ZClasses.

Shane

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




[Zope-dev] Programatically trying to create recursive folders

2000-10-13 Thread Jason Spisak

Zopists,

In orderto get around the confliting writes issues I am experiencing, I
would like to create
recrusive folders like, /0/1, /0/2, etc., so that my objects will be in
many different folders.
I am trying to get DTML to create these pre-set drop folders
automatically, but am unable to do so.

The following code throws an id already in use error, because the 'with'
tag is not letting the newly
created object's namespace be used for the creation of the second
folder.

dtml-in expr="_.range(0, 2)"
 dtml-with "manage_addFolder(_.str(_['sequence-item']),
_.str(_['sequence-item']))"
  dtml-in expr="_.range(0, 2)"
   dtml-call "manage_addFolder(_.str(_['sequence-item']),
_.str(_['sequence-item']))"
  /dtml-in
 /dtml-with
/dtml-in

Any ideas?

All my best,

Jason Spisak
[EMAIL PROTECTED]

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