Re: [Zope] image processing site quidance...

2006-02-23 Thread Nicolas Georgakopoulos



Chris Withers wrote:

Nicolas Georgakopoulos wrote:


I don't have any experience writing external products... should be 
easy if I finish the python programming part as a simple traditional 
python release and then to implement it as a Zope product ?


Yeah, sure be easy enough... and we're to help if you run into 
problems :-)

Thanks (again) Chris :-)


For what part of my needs should I read about ZODB ? Can't 
understand  the not to read whole image objects at once


Where are you storing your image data?
That's the point , I think it will be easier (for me) if I write a 
python program that is called by Zope external method to make the image 
processing in the local file system.
So the image files should be uploaded in the local files system to be 
processed and then able to be read it from Zope to be displayed and 
downloaded 

Is there a strong reason to do it otherwise  (ZODB) ?
begin:vcard
fn:Nicolas Georgakopoulos
n:Georgakopoulos;Nicolas
email;internet:[EMAIL PROTECTED]
tel;work:2810 391945
tel;fax:2810 391937
tel;cell:6945 714 578
version:2.1
end:vcard

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


Re: [Zope] image processing site quidance...

2006-02-21 Thread Nicolas Georgakopoulos



Tino Wildenhain wrote:

Nicolas Georgakopoulos schrieb:
  

Hello Zopistas,

I need a little guidance for a site that must make image processing on
the fly.
Users should be able to upload image files and after some pixels
manipulation they should see the image preview after the changes and
download it.



You should be much more precise about what some pixels manipulation
actually means :-) Writing a drawing program is not so easy I think.
Maybe with more client side intelligence...
  
It will not be some kind of drawing program , just some simple changes 
in the pixels values.

I have installed PIL successfully for that reason (thanks to smiley
Chris) so I can use it as an external method.



For more then just a single convert (even then) I'd write a complete
external product. Its much easier to test and install and can do more.
  
I don't have any experience writing external products... should be easy 
if I finish the python programming part as a simple traditional python 
release and then to implement it as a Zope product ?

I have thought to do this implementation uploading the file to the
ZopeDB and change it there or should the file be uploaded in the local
file system ?



Actually depends on what you want to do and what you want to do
after the changes. E.g. do you want to save a complete history
of the manipulation? Then I'd go ZODB completely. If you dont
want to save the image, I'd go tempfiles and pass the handles
to them around the SESSION. (see tempfile module)

Maybe a combination is apropriate.
  

Saving the history of the image process  actions it is not required.
Saving the images ... maybe. I will check this tempfile module.

either way , what should I know so I can do that ?



You should experiment with PIL - maybe outside zope.
  
Im am already experimenting with PIL in a python shell and learning PIL 
it is not my purpose of this mail ;-)



You should learn how to write a simple python based
product. 

Will check the Zope book  for that..

You should read about ZODB programming so
not to read whole image objects at once.
  
For what part of my needs should I read about ZODB ? Can't understand  
the not to read whole image objects at once


cheers..
begin:vcard
fn:Nicolas Georgakopoulos
n:Georgakopoulos;Nicolas
email;internet:[EMAIL PROTECTED]
tel;work:2810 391945
tel;fax:2810 391937
tel;cell:6945 714 578
version:2.1
end:vcard

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


[Zope] image processing site quidance...

2006-02-20 Thread Nicolas Georgakopoulos

Hello Zopistas,

I need a little guidance for a site that must make image processing on 
the fly.
Users should be able to upload image files and after some pixels 
manipulation they should see the image preview after the changes and 
download it.
I have installed PIL successfully for that reason (thanks to smiley 
Chris) so I can use it as an external method.


I have thought to do this implementation uploading the file to the 
ZopeDB and change it there or should the file be uploaded in the local 
file system ?


either way , what should I know so I can do that ?

thanks in advance.
begin:vcard
fn:Nicolas Georgakopoulos
n:Georgakopoulos;Nicolas
email;internet:[EMAIL PROTECTED]
tel;work:2810 391945
tel;fax:2810 391937
tel;cell:6945 714 578
version:2.1
end:vcard

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


Re: [Zope] Leave the ivory tower now!

2006-01-16 Thread Nicolas Georgakopoulos

Rakotomandimby Mihamina wrote:

On Mon, 2006-01-09 at 14:29 +0100, Garito wrote:
  

I thing DTML and ZClasses will disapear someday



You think, I hope :-)

  

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

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Re: Leave the ivory tower now!

2005-12-25 Thread Nicolas Georgakopoulos



Bakhtiar A Hamid wrote:




On 12/24/05, *Michael Haubenwallner* [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED] wrote:




The batch limit is set to '300', limiting the display of a sorted
result
set.

Here are numbers from the database:
   old style howtos :   1986 (created until 2003)
   new style howtos :251 (created after the transition to
plone)
   new published howtos : 90

The 'closed group' dissolved a while ago.



that's sad(?)  anything came out of the group?  i think we need to do 
to zope.org http://zope.org what we did to zope2.  ignore and 
build.  leave it as old.zope.org http://old.zope.org and link from 
the new site.


happy holidays


Hth,
Michael


Ignore and build , I agree too :-)

Merry Christmas from Greece !
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Re: Leave the ivory tower now!

2005-12-23 Thread Nicolas Georgakopoulos



Michael Haubenwallner wrote:


Nicolas Georgakopoulos wrote:


Here are my ideas to make Zope 3 the most successful framework ever:


Make them love Zope at the very first look:

   * Make installing Zope a double-click or one-command-only 
experience and

   * offer a 30 minutes tutorial of programming an useful application
 including an audiovisual show for an appetizer that offers a 
feeling

 of success.

Enable the beginners:

   * Easy to read and understand ‹ but still complete and current ‹
 documentation is a must.
   * Avoid cluttering everything about Zope across articles, blogs, 
chats,
 mailing lists and wikis. Keep everything available and 
searchable at

 one central location.


 



I think Make them love Zope at the very first look and Enable the 
Beginner is on the same issue , I consider my self a beginner and 
trying to learn Zope I found many resources on google but a little 
bit of chaos , a better united source from the central Zope 
(Zope.org) it is required. I is a shame to know that there is a big 
help and a big community but not so well united and organized.
Zope Book 2.7 it is in the same stage it was before 3,5 months ago 
when I started to reading it with some example only in DTML when Zope 
encourage leaving DTML for ZPT.
The how-to section 
(http://www.zope.org/Documentation/How-To/index_html?sort_on=modifiedsort_order=reverse) 
have *_only_* 3 post's for the year *2005 *!!!
A Zope editor is a must or to find another way more flexible ! 
external editor product it is steel a way but a ugly way in my 
opinion (no offense for the product) , to add numbers on every line 
when coding it will be a big step.


I don't want to blame the official Zope team , the are running with 
hard work for sure. It is just that Zope can do so much thing's 
compare to other products out there but important details have been 
left unaccomplished...


I hope the point of this mail is to make Zope better and not to be 
considered as an accusation or an attack...


Zope need and can become better :)




zope.org HowTos are something between 1000 and 3000 documents. 
Everyone  wanting to help to review and consolidate that information 
is welcome to send a note to [EMAIL PROTECTED] or to the zope-web 
mailing list (zope-web@zope.org).


Michael


I think you are wrong , on Zope site it say's - Zope How-Tos 1- 20 of 300

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

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] batching help

2005-12-19 Thread Nicolas Georgakopoulos
Thanks a lot , I did it with my 'ugly' way but that was exactly what I 
was looking for.


cheers..

Martijn Pieters wrote:


On 12/15/05, Nicolas Georgakopoulos [EMAIL PROTECTED] wrote:
 


Hello all , I'm trying to display on the same page a table with (3
columns) with content from a list . I'm trying to batch the results so
that every 3 elements anothe row is created.
Can anyone give me a clue how to do that ?
   



Use batches and the following recipe:

http://zopelabs.com/cookbook/998066576


--
Martijn Pieters
 


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

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] batching help

2005-12-15 Thread Nicolas Georgakopoulos
Hello all , I'm trying to display on the same page a table with (3 
columns) with content from a list . I'm trying to batch the results so 
that every 3 elements anothe row is created.

Can anyone give me a clue how to do that ?

this is my code:


table tal:define=Rnumber 
python:context.cm1.content.specialfile.getList('link_list') ; batch 
python:modules['ZTUtils'].Batch(Rnumber,size=3,start=0)

   th colspan=3Main Title/th
   trthTitle 1/ththTitle 2/ththTitle 3/th/tr
   tr
   td tal:repeat=num batch
   span tal:condition=python:num  3 
tal:replace=structure num content goes here.. /span

   /td
   /tr
 !--  tr

   td tal:repeat=num batch
   span tal:replace=structure num 
Material goes here /span

   /td
   /tr --  
   /table

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

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] batching help

2005-12-15 Thread Nicolas Georgakopoulos

Dragos Chirila wrote:


Hi

I suggest to use the following function that

def get_grouped_list(self, seq=[], size=3):
#get the list with all items grouped
return [seq[i:i+size] for i in range(0, len(seq), size)]

that takes as parameter a list and goups items in slices with length = 
size.


 def get_grouped_list(seq=[], size=3):
... return [seq[i:i+size] for i in range(0, len(seq), size)]
...
 l = [1,2,3,4,5,6,7,8]
 get_grouped_list(l)
[[1, 2, 3], [4, 5, 6], [7, 8]]
 get_grouped_list(l, 4)
[[1, 2, 3, 4], [5, 6, 7, 8]]


Then iterating this is something like:

tr tal:repeat=slice python:someobject.get_grouped_list(yourlist)
td tal:repeat=item slice
span tal:replace=item /
/td
/tr


Hope this will help.
Dragos


Nicolas Georgakopoulos wrote:

Hello all , I'm trying to display on the same page a table with (3 
columns) with content from a list . I'm trying to batch the results 
so that every 3 elements anothe row is created.

Can anyone give me a clue how to do that ?

this is my code:


table tal:define=Rnumber 
python:context.cm1.content.specialfile.getList('link_list') ; batch 
python:modules['ZTUtils'].Batch(Rnumber,size=3,start=0)

   th colspan=3Main Title/th
   trthTitle 1/ththTitle 2/ththTitle 3/th/tr
   tr
   td tal:repeat=num batch
   span tal:condition=python:num  3 
tal:replace=structure num content goes here.. /span

   /td
   /tr !--  tr
   td tal:repeat=num batch
   span tal:replace=structure num 
Material goes here /span

   /td
   /tr 
-- /table

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




Thanks for your suggestion Dragos , I want to do it the zope batch way 
(I suppose it is simpler) if I can...

I will keep in mind your function if nothing else can be done.

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

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] error trying to import smtplib (unauthorized)

2005-10-14 Thread Nicolas Georgakopoulos

Chris Withers wrote:


Nicolas Georgakopoulos wrote:

I will try VerboseSecurity for a last chance ... if it doesn't work I 
will install the lates Zope release.



No, you haven't anyway taken me through, step by step, what you've 
done to get where you are...


What release of Zope are you using?

Chris

I unistall zope and install it again with version Zope-2.8.2-final and 
put your product on C:\Zope-Instance\Products\MailTemplates


I run Zope with admin priviledges and :

1.Created a folder with id MailTesting on the root.

2.Created a MailHost object with id MailHost inside MailTesting folder.

3.Created a MailTemplate object with the id my_mt and selected my 
MailHost object (from step 2) inside MailTesting folder.


4.Created a python script inside MailTesting folder with the id 
send_mail and change your code only in the part : 
mto=('[EMAIL PROTECTED]',[EMAIL PROTECTED]), --  mto='[EMAIL PROTECTED]',


5.Created a file with the id  myfile.bin and loaded a txt file inside 
MailTesting folder.


6.Have changed in _all objects_ and in the _folder_ the _permissions_ on 
the security tab of each one (_I checked all the checkboxes!!!_)


7.Try to run the python script from the test tab ...  :
It prompt for user name and password.
User name and password given correct and it keep prompting the same.
Some how this action log me out from Zope.

8.To check the error log I must log in again.There are 2 errors :

A) admin (admin)  Unauthorized: You are not allowed to access 'add_file' 
in this context  
(when I was trying to test the script with my account )


B) Anonymous User (None) Unauthorized: strongYou are not authorized to 
access this resource./strong  
(when I log on again to see the error log)


traceback for A:
Traceback (innermost last):
 Module ZPublisher.Publish, line 113, in publish
 Module ZPublisher.mapply, line 88, in mapply
 Module ZPublisher.Publish, line 40, in call_object
 Module Shared.DC.Scripts.Bindings, line 311, in __call__
 Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec
 Module Products.PythonScripts.PythonScript, line 323, in _exec
 Module None, line 6, in send_mail
  - PythonScript at /MailTesting/send_mail
  - Line 6
Unauthorized: You are not allowed to access 'add_file' in this context

traceback for B:
Traceback (innermost last):
 Module ZPublisher.Publish, line 104, in publish
 Module ZPublisher.BaseRequest, line 461, in traverse
 Module ZPublisher.HTTPResponse, line 684, in unauthorized
Unauthorized: strongYou are not authorized to access this 
resource./strong


9.If I press cancel when I run the python script your product show me 
this error message:


strongError Type: Unauthorized/strongbr/
strongError Value: You are not allowed to access 'add_file' in this 
context/strongbr/ 



Is that what you want ?

I will install VerboseSecurity (my last hope)

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

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] error trying to import smtplib (unauthorized)

2005-10-14 Thread Nicolas Georgakopoulos

Chris Withers wrote:


Nicolas Georgakopoulos wrote:



FINALLY it work's! I installed VerboseSecurity and repeat the same 
action'sit just work.



Right, well, that's not good news ;-)
As Jens pointed out VerboseSecurity shouldn't be installed in 2.8, 
which I only just found out...


The fact that it makes things work is... interesting.

Anyway, I can now reproduce the issue, and I know what it is, so I'll 
see if I can get it fixed some time soon...


cheers, and thanks for putting up with me trying ot find out what's 
wrong...


Chris


thank you for your support !

keep the good work.

thank's again.
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] MailTemplate attachment problem..

2005-10-13 Thread Nicolas Georgakopoulos

Trying to send an attachment I get another error:
strongError Type: Unauthorized/strongbr/
strongError Value: You are not allowed to access 'add_file' in this 
context/strongbr/


and the traceback:
Traceback (innermost last):
  Module ZPublisher.Publish, line 113, in publish
  Module ZPublisher.mapply, line 88, in mapply
  Module ZPublisher.Publish, line 40, in call_object
Module Shared.DC.Scripts.Bindings, line 311, in __call__
Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec
Module Products.PageTemplates.ZopePageTemplate, line 256, in _exec
Module Products.PageTemplates.PageTemplate, line 102, in pt_render
   - ZopePageTemplate at /AtestFordelete/tt
  Module TAL.TALInterpreter, line 206, in __call__
  Module TAL.TALInterpreter, line 250, in interpret
  Module TAL.TALInterpreter, line 426, in do_optTag_tal
  Module TAL.TALInterpreter, line 411, in do_optTag
  Module TAL.TALInterpreter, line 406, in no_tag
  Module TAL.TALInterpreter, line 250, in interpret
  Module TAL.TALInterpreter, line 501, in do_insertText_tal
  Module Products.PageTemplates.TALES, line 227, in evaluateText
Module Products.PageTemplates.TALES, line 221, in evaluate
   - URL: /AtestFordelete/tt
 - Line 12, Column 6
 - Expression: standard:'options/message'
 - Names:
  {'container': Folder at /AtestFordelete,
   'context': Folder at /AtestFordelete,
 'default': Products.PageTemplates.TALES.Default instance at 
0x01152AF8,

   'here': Folder at /AtestFordelete,
 'loop': Products.PageTemplates.TALES.SafeMapping object at 
0x01FC2990,
 'modules': 
Products.PageTemplates.ZRPythonExpr._SecureModuleImporter instance at 
0x0112DD50,

 'nothing': None,
   'options': {'args': ()},
 'repeat': Products.PageTemplates.TALES.SafeMapping object at 
0x01FC2990,
   'request': HTTPRequest, 
URL=http://localhost:8080/AtestFordelete/tt,

 'root': Application at ,
   'template': ZopePageTemplate at /AtestFordelete/tt,
 'traverse_subpath': [],
 'user': admin}
Module Products.PageTemplates.Expressions, line 183, in __call__
Module Products.PageTemplates.Expressions, line 171, in _eval
Module Products.PageTemplates.Expressions, line 127, in _eval
 - __traceback_info__: options
  Module Products.PageTemplates.Expressions, line 306, in 
restrictedTraverse
   - __traceback_info__: {'path': ['message'], 
'TraversalRequestNameStack': []}

KeyError: 'message'

I had change all my security options in the folder that contains my 
objects (checked all the boxes on the Manager colum).

Am I doing something wrong?
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] help with MailTemplates 1.0.0

2005-10-13 Thread Nicolas Georgakopoulos

Chris Withers wrote:


And to send the attachment I get another error:
strongError Type: Unauthorized/strongbr/
 strongError Value: You are not allowed to access 'add_file' in 
this context/strongbr/


The user executing the python script that calls add_file needs to have 
the 'Use mailhost services' permission, did they?
Shane Hathaway's VerboseSecurity product may help you figure out 
what's going on...


Why should I use this product? I'm a Manager user and I have permission 
in the current folder where the object's is to Use MailHost Services , 
Add Documents, Images, and Files 
http://localhost:8080/AtestFordelete/attachment_test/manage_permissionForm?permission_to_manage=Add%20Documents%2C%20Images%2C%20and%20Files 
and Change Images and Files 
http://localhost:8080/AtestFordelete/attachment_test/manage_permissionForm?permission_to_manage=Change%20Images%20and%20Files

I change the python script code to :
 
from email.MIMEBase import MIMEBase

msg=container.my_mt.as_message(
 mfrom='[EMAIL PROTECTED]',
 mto='[EMAIL PROTECTED]',
 message='This is a test!',
 subject='Attempt 100 !')
msg.send()

*have removed the -msg.add_file(container['myfile.bin']) and Zope 
prompts for user name and password. Whatever I write (correct login or 
not) it keeps prompting the same.

If  I choose cancel your product show me the current message:

strongError Type: Unauthorized/strongbr/
strongError Value: You are not allowed to access 'send' in this 
context/strongbr/


No error is reported in the error log...


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

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] error trying to import smtplib (unauthorized)

2005-10-13 Thread Nicolas Georgakopoulos

Trying to execute the following code from a python script

from smtplib import SMTP
from email.MIMEText import MIMEText

I get a error:

*Error Type: ImportError*
*Error Value: import of SMTP from smtplib is unauthorized. You are 
not allowed to access 'SMTP' in this context

*
Why I can't access SMTP if I am a user manager with all the access 
enabled for managers in the current context ?

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

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] error trying to import smtplib (unauthorized)

2005-10-13 Thread Nicolas Georgakopoulos

David Convent wrote:


Python scripts are run in a restricted environment,
move your code to either an external method or a python zope product 
built on the filesystem


How can I move the code to another python zope product ?
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] error trying to import smtplib (unauthorized)

2005-10-13 Thread Nicolas Georgakopoulos

Chris Withers wrote:


Nicolas Georgakopoulos wrote:

I will try VerboseSecurity for a last chance ... if it doesn't work I 
will install the lates Zope release.



No, you haven't anyway taken me through, step by step, what you've 
done to get where you are...


What release of Zope are you using?

Chris


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

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] help with MailTemplates 1.0.0

2005-10-12 Thread Nicolas Georgakopoulos

Chris Withers wrote:


Nicolas Georgakopoulos wrote:

Whatever you have selected is resolving to a string instead of a 
MailHost object :-S



I have selected a Zope mailhost object



Please explain exactly what you did, including how you create the 
MailHost, the Mail Template and the Python Script, in detail...


I just tried to reproduce this on a fresh Zope 2.8.1 instance and 
couldn't...


Using the first example, the mail rendered and sent just fine.

I'm still far from convinced the thing you think is a MailHost object 
is actually a MailHost object, did you perhaps delete or rename your 
MailHost object?


Chris

I make it work , the fist time I try to use it I had copied my Mailhost 
object from another folder and it wasn't working. I delete it and create 
another one with a different name. When I go to the MailTemplate object 
to chooses my new MailHost it was already selected but still not 
working. The problem was solved when I push the save button any way and 
it works ...


Trying to execute the attachment example , you forgot to put ' ' on the 
second mail address  line: mto=('[EMAIL PROTECTED]',[EMAIL PROTECTED]),

And to send the attachment I get another error:
strongError Type: Unauthorized/strongbr/
 strongError Value: You are not allowed to access 'add_file' in this 
context/strongbr/


and the traceback:

Traceback (innermost last):
   Module ZPublisher.Publish, line 113, in publish
   Module ZPublisher.mapply, line 88, in mapply
   Module ZPublisher.Publish, line 40, in call_object
 Module Shared.DC.Scripts.Bindings, line 311, in __call__
 Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec
 Module Products.PageTemplates.ZopePageTemplate, line 256, in _exec
 Module Products.PageTemplates.PageTemplate, line 102, in pt_render
- ZopePageTemplate at /AtestFordelete/tt
   Module TAL.TALInterpreter, line 206, in __call__
   Module TAL.TALInterpreter, line 250, in interpret
   Module TAL.TALInterpreter, line 426, in do_optTag_tal
   Module TAL.TALInterpreter, line 411, in do_optTag
   Module TAL.TALInterpreter, line 406, in no_tag
   Module TAL.TALInterpreter, line 250, in interpret
   Module TAL.TALInterpreter, line 501, in do_insertText_tal
   Module Products.PageTemplates.TALES, line 227, in evaluateText
 Module Products.PageTemplates.TALES, line 221, in evaluate
- URL: /AtestFordelete/tt
  - Line 12, Column 6
  - Expression: standard:'options/message'
  - Names:
   {'container': Folder at /AtestFordelete,
'context': Folder at /AtestFordelete,
  'default': Products.PageTemplates.TALES.Default instance at 0x01152AF8,
'here': Folder at /AtestFordelete,
  'loop': Products.PageTemplates.TALES.SafeMapping object at 0x01FC2990,
  'modules': Products.PageTemplates.ZRPythonExpr._SecureModuleImporter 
instance at 0x0112DD50,
  'nothing': None,
'options': {'args': ()},
  'repeat': Products.PageTemplates.TALES.SafeMapping object at 0x01FC2990,
'request': HTTPRequest, URL=http://localhost:8080/AtestFordelete/tt,
  'root': Application at ,
'template': ZopePageTemplate at /AtestFordelete/tt,
  'traverse_subpath': [],
  'user': admin}
 Module Products.PageTemplates.Expressions, line 183, in __call__
 Module Products.PageTemplates.Expressions, line 171, in _eval
 Module Products.PageTemplates.Expressions, line 127, in _eval
  - __traceback_info__: options
   Module Products.PageTemplates.Expressions, line 306, in restrictedTraverse
- __traceback_info__: {'path': ['message'], 'TraversalRequestNameStack': []}
KeyError: 'message'

I had change all my security options in the folder that I'm using the example 
objects (checked all the boxes on the Manager colum).
Am I doing something wrong?

PS: The test mail I received on the first simple example,  the part  a 
href=tal:define=url root/absolute_url tal:attributes=href url 
tal:content=url/ doesn't render right , it actually show in the body 
of my message mail  like --  your interest in: a 
href=http://localhost:8080; 
http://localhost:8080/http://localhost:8080 http://localhost:8080//a


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

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] How to create a file and send it by e-mail ?

2005-10-11 Thread Nicolas Georgakopoulos
Hello all, I'm developing using ZPT and I need to create a file (CSV 
format) but I'm having some problems:


* 1. *I only know how to create files with python but I get an
*Error Type: NameError*
*Error Value: global name 'file' is not defined.

* I think ZOPE doe's not allow python to create files for security 
reasons. Can I change this security policy or it will make my 
application unsafe? Is there another way to create a file using ZOPE API 
calls ?


* 2.*When I create my file how can I send it as an attachment by mail ? 
(I already have setup my mail host object and I can send mail's 
successfully.)


thanks for your time..

*

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

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] help with MailTemplates 1.0.0

2005-10-11 Thread Nicolas Georgakopoulos
I installed the MailTemplates product to Zope and try to run the example 
from the readme file:

--
Simple Example
 This example sends a simple templated mail to a specific
 address.
 Add the following to a Mail Template called my_mt:

 tal:body xmlns:tal=http://xml.zope.org/namespaces/tal;
 xmlns:metal=http://xml.zope.org/namespaces/metal;
 Dear tal:x replace=options/mto/,

 tal:x replace=user/getId/ would like to thank you for
 your interest in:
 a href=
tal:define=url root/absolute_url
tal:attributes=href url
tal:content=url/

 tal:x replace=option/message/
  cheers,
 The Web Team
 /tal:body

 Now add a Script (Python) in the same folder containing the
 following:

 container.my_mt(
 mfrom='[EMAIL PROTECTED]',
 mto='[EMAIL PROTECTED]',
 message='This is a test!'
 )

 return 'Mail Sent!'
--

 I cant make it work, when I try to test the python script I get a 
page like this :


h2Site Error/h2

 pAn error was encountered while publishing this resource.
 /p
 
 p

 strongError Type: KeyError/strongbr/
 strongError Value: u'option'/strongbr/ 
 /p


can anyone give me a clue ?




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

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] help with MailTemplates 1.0.0

2005-10-11 Thread Nicolas Georgakopoulos

Chris Withers wrote:


(for the 2nd time, please keep this on the list...)
(just for the light on thinking, that means hit reply all or make 
sure zope@zope.org is in the cc list)


Sorry for that , it was on purpose.. I'm new to Zope and thought that it 
wasn't right to bother the rest of the list with my beginner problem...



Nicolas Georgakopoulos wrote:

Your documentation have anothe problem , you forgot to set a subject 
in your example :(



Oh dear, yes, I remember, I recently made subject required :-S
I'll have to fix that soon...


After I set a subject it say's :

strongError Type: AttributeError/strongbr/
strongError Value: 'str' object has no attribute '_send'/strongbr/
I don't know how to setup the _send attribute



Yes, and? Where's the rest of the traceback? I can't help you without 
it..


cheers,

Chris


Traceback (innermost last):

 Module ZPublisher.Publish, line 113, in publish
 Module ZPublisher.mapply, line 88, in mapply
 Module ZPublisher.Publish, line 40, in call_object
 Module Shared.DC.Scripts.Bindings, line 311, in __call__
 Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec
 Module Products.PythonScripts.PythonScript, line 323, in _exec
 Module None, line 1, in mailAction.py
  - PythonScript at /testFordelete/mailAction.py
  - Line 1
 Module Products.MailTemplates.BaseMailTemplate, line 117, in send
 Module Products.MailTemplates.BaseMailTemplate, line 107, in _send
AttributeError: 'str' object has no attribute '_send'

Thank's for your help, looking forward to test your product tomorrow ;) (don't 
have more time for today)

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

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] help with MailTemplates 1.0.0

2005-10-11 Thread Nicolas Georgakopoulos

Chris Withers wrote:


Nicolas Georgakopoulos wrote:



Sorry for that , it was on purpose.. I'm new to Zope and thought that 
it wasn't right to bother the rest of the list with my beginner 
problem...



The opposite is true.. by keeping this on the list, not only can other 
people help out, but other people can learn, and this becomes a 
resource for others once archived by google and gmane ;-)



 Module Products.MailTemplates.BaseMailTemplate, line 117, in send
 Module Products.MailTemplates.BaseMailTemplate, line 107, in _send
AttributeError: 'str' object has no attribute '_send'



Hmmm, what have you selected in the MailHost drop-down on the Mail 
Template's edit page?


Whatever you have selected is resolving to a string instead of a 
MailHost object :-S


I have selected a Zope mailhost object



cheers,

Chris

PS: What Zope version are you using?


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

http://mail.zope.org/mailman/listinfo/zope-dev )