Re: [Zope-dev] Re: [Zope] Container Class questions

2000-10-09 Thread Robin Becker

In article [EMAIL PROTECTED], Kapil Thangavelu
[EMAIL PROTECTED] writes
...
One of the things I wanted to do was to add a multiple selection
property to the default properties in the Thing_add method. In order to
do this in multiple zclasses I wanted to have a product wide
variable/property/method to use as the allowed list. I could find no way
to do that. As always with Zope there seem to be different
inheritances/scopes at different times. Statically I can add a property
to the product say projectList and it is visible when I add properties
to a property sheet. So product wide things are visible statically,
however projectList doesn't seem to be visible to my Thing_add method
when I use

manage_addProperty('projects','projectList','multiple selection') ie

I get an error saying projectList isn't known. Clearly product wide
methods are intended to be known at create time so why not properties?
-- 
Robin Becker

___
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] MailHost Improvements

2000-10-09 Thread Kapil Thangavelu


There has been intermittent talk of improving mailhost's ability to
scale. i just wanted to solicit some comments to some ideas for
improving mail host performance. 

Stage I. Persistent Socket
1. make the smtp connection persistent
2. preface sending mail with a 'noop' operation to verify connection
status
3. overide __setstate__ to open connection

i'm not sure if this will yield any real world benefit but i like the
style better than opening a new connection for every new message.

Stage II. Transaction Aware
1. Store sent mail in a volatile 
2. on transaction commit begin (tpc_begin), send all mail, if error
abort transaction
3. reset volatile

again i'm not sure of real world performance, but the design seems
better and the added benefit that it will play nicely with the
transaction machinery and not send unesc. emails.


Stage III. Intelligent Q. aka the BulkMailHost

1. implement mailer thread / sole function to send mails from queue and
intelligently manage a outgoing queue and deferred queue.
2. implement extensions to sendmail tag for immediate sending of mail
which will wake/signal mailer thread after depositing into outgoing q.
extension options are

3. mailer thread on a timer, so it will wake on either a sendmail tag
with immeadiate extension or on timer expiration and send mail from
queue, messages with error due to connection or placed in deferred
queue. messages with undelivarable errors are either deleted or placed
in a deleted queue.

4. all queues are viewable and manageable from the management interface. 


obviously this makes the sendmail tag async to the message being sent.

i'm not sure if this something that really should be implemented in a
ZODB default file storage due to the high write nature of the system or
just dumped to the fs. again this seems questionable also because a
proper mta should be operating on a store and send principle
(qmail/postfix).

comments?

hmmm... looking through the source of the 2.2.2 mailhost i see a
scheduledSend method, anyone know what this is from/for?

Cheers

Kapil

___
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] ZPublisher.Client

2000-10-09 Thread Andrew Edmondson

I used to use Client.py quite a lot for calling zope objects through the web
from python.

However, now that I've upgraded to Zope 2.x it fails.


(Zope 2.2 ZPublisher, connecting to Zope 2.1.2)
Traceback (innermost last):
  File "/u/g/aedmondson/backups/pack_db.py", line 22, in ?
pack()
  File "/u/g/aedmondson/backups/pack_db.py", line 19, in pack
return(apply(Client.Function(place,username=user, password=pwd), (),
kw))
  File "/usr/local/ZOPE2.1.2/lib/python/ZPublisher/Client.py", line 221, in
__call__
raise NotAvailable, RemoteException(
bci.NotAvailable: (111, 'Connection refused') (File:
http://localhost/Zope/fastcgi/Control_Panel/Database/manage_pack Line:
days:int=0)
None None for None

(Both Zope 2.2 (in fact, the same python))
Traceback (innermost last):
  File "stdin", line 11, in ?
  File "stdin", line 8, in test
  File "/usr/local/Zope-2.2.0-linux2-x86/lib/python/ZPublisher/Client.py",
line 221, in __call__
raise NotAvailable, RemoteException(
bci.NotAvailable: argument 1: expected read-only character buffer, tuple
found (File: http://localhost/idm Line: [])
None None for None

Is this a problem with ZPublisher, or me?

Thanks,

-Ed


___
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] build Zope on linux

2000-10-09 Thread Sin Hang Kin

When building current zope cvs, cPickle.c want the mymath.h. Where can I get
mymath? What devel package I should install for a debian system?


Rgs,

Kent Sin
-
kentsin.weblogs.com
kentsin.imeme.net


___
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] build Zope on linux

2000-10-09 Thread Gregor Hoffleit

On Mon, Oct 09, 2000 at 10:00:52PM +0800, Sin Hang Kin wrote:
 When building current zope cvs, cPickle.c want the mymath.h. Where can I get
 mymath? What devel package I should install for a debian system?

To compile binary Python extensions with Debian (as Zope needs), you need
the python-dev package:

apt-get install python-dev



Gregor


___
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] basci properties

2000-10-09 Thread Robin Becker

In message [EMAIL PROTECTED], Paul Erickson [EMAIL PROTECTED] writes

Well I was trying to get a self contained class initialisation using a bit of python

I had defined a propertsheet called ClassConstants containing a tokens property with
"A B C" in my extern method initialiser I was doing 

self = self.this()
obj = self.ZC.createInObjectManager(id, REQUEST)
obj.manage_addProperty('t','tokenList','multiple selection')

in the add form I could not seem to get access to the property tokenList
 ie
 I wasn't getting nice things from either
 dtml-with "_.namespace(S=tokenList)"

not seeing the property.

or 

 dtml-with "_.namespace(S=Control_Panel.Products.myProduct.ZC.propertysheets.common
.ClassConstants.getProperty('tokenList')

failing with a permissions problem

in the end I had to define a product external method called getTokenList
which did
def getQProjectList(self):
obj = self.unrestrictedTraverse("Control_Panel/Products/myProduct/ZC/propert
ysheets/common/ClassConstants")
return obj.getProperty('tokenList')

How does one define properties which are visible at construction time?


Just create a ZClass that inherits from ObjectManager, then you will
have to use the Subobjects tab to tell it what kind of objects it can
contain.

For properties, click on the Property Sheets tab and add one (be sure
you're in the class, not the product). Put whatever properties on it
that you like. Remember that properties won't get set in the constructor
unless you uncomment the 

dtml-call "propertysheets.Basic.manage_editProperties(
  REQUEST)"
line in the constructor.  (change "Basic" if that's not what you called
your property sheet.

Robin Becker wrote:
 
 I want to create a ZClass that is essentially a folder with some added
 properties. I can see no way to add to the Basic properties of my
 ZClass.
 
 Is there a way to do that?
 --
 Robin Becker
 
 ___
 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 )
-- 
Robin Becker

___
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] Strange permissions in the (built-in) API reference

2000-10-09 Thread Dieter Maurer

I have just thouroughly looked through the API reference
which is built in Zope 2.2.2.

I found many strange permission statements, e.g.:

  * all methods of "PropertySheets" can only be used from Python

  * while "PropertySheet.propertyItems" can be used with
permission "Access Contents Information",
"PropertySheet.getProperty" can be used from Python only

  * "ObjectManagerItem.restrictedTraverse" can be used
from Python only

  * some permission are given as "XXX" (e.g.
"ObjectManagerItem.this")


I wonder, if this is caused by the API reference being shipped
with "data.fs.in" (which, in my case, is old, at least 2.2.1).

If this would be the case, then it might be better to have such
documentation outside in the file system, as "data.fs" tends
to taken over from older installations to newer ones.


Besides, there are many small problems with structured text.
One particular instance is the removal of default arguement
values '', caused by the interpretation of "'".


Dieter

___
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: Trying to catch up - what are the best Zope tools today?

2000-10-09 Thread Itai Tavor

Itai asked:

  "I started reading about ZPatterns but I still can't get my head
  around it... I'm wondering if I should try to learn it fast enough
  for this project, or stick to what I already know. What in people's
  experience is the typical learning curve for ZPatterns? How much am I
  going to have to figure out to be able to build support for SQL
  storage?

FYI ZPatterns has been a rapidly moving target, but it's looking pretty
solid now, and a few folks have managed to wade in and make sense of it
already. There's even some documentation at :

   http://www.zope.org/Members/pje/Wikis/ZPatterns/HomePage

Most of the discussions you'll see on this list between Steve Spicklemire
and Phil Eby / Ty Sarna are directly related to the next rev. of EMarket,
which will be based on ZPatterns. If you think the flexibility that comes
from a cleanly implemented Object Pattern will be worth the learning curve,
ZPatterns is just about there now.

The "how" of storing data in an RDBMS, accessed with ZSQLMethods is no
different with ZPatterns. The real difference is "who" does the storage
and retrieval. This is the concept of the "Specialist" object, which
"knows" all about the specifics of the data and storage implementation.

In any case, get to know ZClasses and PythonMethods, which may not have
been ready for prime time, or even released, last time you looked. Those
will be useful no matter which direction you choose.

Later,
Jerry S.

Thanks. I did work with ZClasses and PythonMethods - I wasn't gone 
that long. I couldn't see how ZPatterns are actually implemented, 
regardless of what tools are used - but I'm getting it slowly, mostly 
by collecting a lot of tips from posts in the list over the past few 
months. ZPatterns looks great and definitely worth the learning curve 
- I'm off to buy Coad's book so I can do it right.
-- 
Itai Tavor"Je sautille, donc je suis."
C3Works[EMAIL PROTECTED]  - Kermit the Frog

"If you haven't got your health, you haven't got anything"


___
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 )