[Zope3-Users] question about MailDir folder for queuedDelivery on windows

2006-11-17 Thread Shailesh Kumar

Hi,

I am trying to use mail:queuedDelivery. It says that the
*...\lib\python\baton\mail_queue is not a Maildir folder*

I am using Zope on Windows-XP box. How can I setup a Maildir folder?

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


Re: [Zope3-Users] question about MailDir folder for queuedDelivery on windows

2006-11-17 Thread Tom Gross

Hi Shailesh,

   just make sure there are three subdirectories available in the 
directory of your mailqueue:

cur, tmp, new. This is the common maildir format.

see: man 5 maildir

  *THE* *MAILDIR* *STRUCTURE*
 A directory in /maildir/ format has three subdirectories, all
 on the same filesystem:  *tmp*, *new*, and *cur*.

 Each file in *new* is a newly delivered mail message.  The
 modification time of the file is the delivery date of the
 message.  The message is delivered /without/ an extra UUCP-
 style *From_* line, /without/ any *From* quoting, and /without/ an
 extra blank line at the end.  The message is normally in RFC
 822 format, starting with a *Return-Path* line and a
 *Delivered-To* line, but it could contain arbitrary binary
 data.  It might not even end with a newline.

 Files in *cur* are just like files in *new*.  The big difference
 is that files in *cur* are no longer new mail:  they have been
 seen by the user's mail-reading program.


Cheers
-Tom

Shailesh Kumar wrote:

Hi,
 
I am trying to use mail:queuedDelivery. It says that the

/...\lib\python\baton\mail_queue is not a Maildir folder/
 
I am using Zope on Windows-XP box. How can I setup a Maildir folder?
 
With regards,

-shailesh
 
 
 



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


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


Re: [Zope3-Users] Utilities naming convention

2006-11-17 Thread FB
Hi,

On Thu, Nov 16, 2006 at 04:09:52PM -0400, David Pratt wrote: Probably should
 have clarified - I am referring to Utility container names not anything to
 do with Python coding standards.

None that I'm aware of. Only the title of the utility's registration matters
for your application - which is '' in very often.
The contained-name is fully independent from the registration's title.
Choose whatever you want. Whenever a part of your application has to link
to a utility of yours, it should use
   zapi.absoluteURL(zapi.getUtility(IMyUtility),request)
which makes knowing the URL unneccessary.

Regards,

Frank

PS: I know, zapi is deprecated - but it's so convenient :-) ...
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] how to access the root folder in normal operation

2006-11-17 Thread Shailesh Kumar

Hi,

zope.traversing.api.getRoot  returns the root of a given object. What I
wanted to do was that when zope starts, I would like to create a few content
objects inside the root folder.

Something like:
root = getRootFolder() #using some way I don't know.
root['etc'] = Folder()
root['var'] = Folder()
...

Is it possible to do that?

With regards,
-shailesh



On 11/15/06, Tom Gross [EMAIL PROTECTED] wrote:


Hi Shailesh,

   have a look at zope.traversing.api. There's a getRoot-method.

Cheers
-Tom

Shailesh Kumar wrote:
 Hi,

 In a functional test setup, one can access the root folder using
 getRootFolder() of FunctionalTestSetup.

 How  can I access the root folder in a nomal operation mode? Is there
 some mechanism to do that?

 Thank you very much.

 With regards,
 -shailesh




 

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


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


Re: [Zope3-Users] how to access the root folder in normal operation

2006-11-17 Thread Tom Gross

Hi Shailesh,

   take a look at zope.app.appsetup. You could subscribe to the 
DatabaseOpenedWithRoot-event.


Cheers
-Tom

Shailesh Kumar wrote:

Hi,
 
zope.traversing.api.getRoot  returns the root of a given object. What 
I wanted to do was that when zope starts, I would like to create a few 
content objects inside the root folder.
 
Something like:

root = getRootFolder() #using some way I don't know.
root['etc'] = Folder()
root['var'] = Folder()
...
 
Is it possible to do that?
 
With regards,

-shailesh
 

 
On 11/15/06, *Tom Gross* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 
wrote:


Hi Shailesh,

   have a look at zope.traversing.api. There's a getRoot-method.

Cheers
-Tom

Shailesh Kumar wrote:
 Hi,

 In a functional test setup, one can access the root folder using
 getRootFolder() of FunctionalTestSetup.

 How  can I access the root folder in a nomal operation mode? Is
there
 some mechanism to do that?

 Thank you very much.

 With regards,
 -shailesh








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





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


Re: [Zope3-Users] how to access the root folder in normal operation

2006-11-17 Thread Thierry Florac
Le vendredi 17 novembre 2006 à 16:59 +0530, Shailesh Kumar a écrit :
 Hi, 
  
 zope.traversing.api.getRoot  returns the root of a given object. What
 I wanted to do was that when zope starts, I would like to create a few
 content objects inside the root folder. 
  
 Something like:
 root = getRootFolder() #using some way I don't know. 
 root['etc'] = Folder()
 root['var'] = Folder()
 ... 
  
 Is it possible to do that? 


I currently use something like this, to handle a site configuration on startup 
(define catalog indexes...) :

from zope.app.appsetup.interfaces import \
IDatabaseOpenedWithRootEvent
from zope.app.publication.zopepublication import ZopePublication
from zope.component import adapter

@adapter(IDatabaseOpenedWithRootEvent)
def handleDatabaseOpenedWithRootEvent(event):
db = event.database
connection = db.open()
root = connection.root()
root_folder = root.get(ZopePublication.root_name, None)
...

And in ZCML :

subscriber
handler=.handleDatabaseOpenedWithRootEvent /


  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


Re: [Zope3-Users] how to access the root folder in normal operation

2006-11-17 Thread Shailesh Kumar

Thank you very much. This technique works perfectly.

-shailesh


On 11/17/06, Thierry Florac [EMAIL PROTECTED] wrote:


Le vendredi 17 novembre 2006 à 16:59 +0530, Shailesh Kumar a écrit :
I currently use something like this, to handle a site configuration on
startup (define catalog indexes...) :

   from zope.app.appsetup.interfaces import \
   IDatabaseOpenedWithRootEvent
   from zope.app.publication.zopepublication import ZopePublication
   from zope.component import adapter

   @adapter(IDatabaseOpenedWithRootEvent)
   def handleDatabaseOpenedWithRootEvent(event):
   db = event.database
   connection = db.open()
   root = connection.root()
   root_folder = root.get(ZopePublication.root_name, None)
   ...

And in ZCML :

   subscriber
   handler=.handleDatabaseOpenedWithRootEvent /


Thierry Florac
--
Chef de projet intranet/internet
Office National des Forêts - Département Informatique
2, Avenue de Saint-Mandé
75570 PARIS Cedex 12
Mél : [EMAIL PROTECTED]
Tél. : +33 01.40.19.59.64
Fax. : +33 01.40.19.59.85


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


[Zope3-Users] zc.table FieldColumn question

2006-11-17 Thread ksmith93940-dev
Does anyone have a simple example of how FieldColumn
is used?

I'm quite sure I'm missing a very serious step here,
but have been unable to figure out how to trigger
the update method. Any help at all would be
appreciated.

I've tried the following, the request values show on
screen but fail to update the object. 


class MovieColumnSubmit(fieldcolumn.SubmitColumn):

def getId(self, item, formatter):

return fieldcolumn.toSafe(item.__name__)

   



class MovieColumn(fieldcolumn.FieldColumn):

def getId(self, item, formatter):

return fieldcolumn.toSafe(item.__name__)





class TableView(BrowserPage):



columns = (

   MovieColumn( IMovieTime['brief']),

  MovieColumn( IMovieTime['times']),

  MovieColumnSubmit(apply, MYFORM),

   )

  

def __call__(self):

items = [value for name, value in
self.context.items()]

formatter = table.Formatter(

self.context, self.request, items,
('brief', 'times', 'MYFORM'),

columns=self.columns,
prefix=tableview)



return htmlhead/headbodyform
action=./@@TableView.html%s/form/body/html
% formatter()  




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


Re: [Zope3-Users] zc.table FieldColumn question

2006-11-17 Thread ksmith93940-dev
Ok, so the following works, but if someone with more
knowledge could comment on this I'd appreciate it.


class MovieColumnSubmit(fieldcolumn.SubmitColumn):

def getId(self, item, formatter):

return fieldcolumn.toSafe(item.__name__)



def update(self, items, data, formatter):

pass



class MovieColumn(fieldcolumn.FieldColumn):

def getId(self, item, formatter):



return fieldcolumn.toSafe(item.__name__)



def update(self, items, data, formatter):

changed = False

for item in items:

id = self.getId(item, formatter)

v = data.get(id, self)

if v is not self and self.get(item,
formatter) != v:

self.set(item, v, formatter)

changed = True

if changed:

self.setAnnotation('changed', changed,
formatter)

return changed



class TableView(BrowserPage):

 Browser Page 



columns = (

   MovieColumn( IMovieTime['brief']),

  MovieColumn( IMovieTime['times']),

  MovieColumnSubmit(apply, MYFORM),

   )

  

def __call__(self):

items = [value for name, value in
self.context.items()]

formatter = table.Formatter(

self.context, self.request, items,
('brief', 'times', 'MYFORM'),

columns=self.columns,
prefix=tableview)

columns = self.columns

for index, value in enumerate(columns):

data = columns[index].input(items,
formatter)

columns[index].update(items, data,
formatter)



return htmlhead/headbodyform
action=./@@TableView.html%s/form/body/html
% formatter()  





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


Re: [Zope3-Users] zc.table FieldColumn question

2006-11-17 Thread Gary Poster


On Nov 17, 2006, at 3:00 PM, [EMAIL PROTECTED] wrote:


Ok, so the following works, but if someone with more
knowledge could comment on this I'd appreciate it.


We have two separate stages (and methods) in our views, update and  
render.  In our views, we *explicitly* call the field columns' input,  
and then call their update during the update stage.  Sometimes we  
only call input/update if some other event happens, like an Apply  
button being clicked on the page.


Then we render.

HTH

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


Re: [Zope3-Users] Utilities naming convention

2006-11-17 Thread David Pratt
Hi Frank, I guess I have just seen more Utilities named this way than 
not - so just confirming things for myself. I am also using zapi all 
over the place. Perhaps I should stop... I am not seeing deprecation 
warnings yet. Many thanks.


Regards
David

FB wrote:

Hi,

On Thu, Nov 16, 2006 at 04:09:52PM -0400, David Pratt wrote: Probably should

have clarified - I am referring to Utility container names not anything to
do with Python coding standards.


None that I'm aware of. Only the title of the utility's registration matters
for your application - which is '' in very often.
The contained-name is fully independent from the registration's title.
Choose whatever you want. Whenever a part of your application has to link
to a utility of yours, it should use
   zapi.absoluteURL(zapi.getUtility(IMyUtility),request)
which makes knowing the URL unneccessary.

Regards,

Frank

PS: I know, zapi is deprecated - but it's so convenient :-) ...
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


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