Re: [Zope] XML Content handling questions.

2005-05-27 Thread Dennis Allison

While you need to write appropriate External Methods and/or Products
to use it, we have found that the ReportLab pyRXP system works well.


On Sat, 28 May 2005, Andreas Jung wrote:

> Zope itself has no native XML support. However there are some products like
> ParsedXML that provide additional functionality. You might also look at 
> Silva CMS
> which is provides native XML support.
> 
> -aj
> 
> --On 27. Mai 2005 14:53:40 -0600 Nikko Wolf <[EMAIL PROTECTED]> 
> wrote:
> 
> > Three questions, in order of importance (to me):
> >
> > 1) Is it possible to validate an (uploaded) XML file against a schema
> >(currently on the Zope server)?
> > What, if any, extra packages are needed?I want to use this in my
> > upload forms to alert the user if their files are invalid.
> >
> > 2) I also need to serve up web-based forms and allow the user to create
> > XML content based on a user-selected schema.  Something
> > like what Chiba (http://chiba.sf.net/) is targeting.   Of course,
> > though, that isn't a Python/Zope solution.  Has anyone seen anything
> > that works?  At this point, installing Tomcat and Chiba is what I
> > presume I'll be doing in a couple of weeks
> >
> > 3) Is there a function built-in to Zope that allows merging XML files?
> > (ie: all the  within a list of user-selected files).
> > I've got an Extension that works correctly (using the Amara/4Suite
> > packages), so an answer here is mostly for me to learn Zope better.
> >
> >
> > Thanks,
> > Nikko.
> >
> > PS: I'm pretty new to Python & Zope, but not web servers or other
> > programming.
> >
> > Server:
> > Fedora Core 3
> > Python 2.3.4
> > Zope 2.7.6-final
> > Plone 2.0.5
> > 4Suite 1.0b1
> > Amara 1.0b2
> >
> >
> >
> > ___
> > 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 )
> 
> 
> 
> 

-- 
Dennis Allison * Computer Systems Laboratory * Gates 227
   * Stanford University *  Stanford CA  94305
   * (650) 723-9213 * (650) 723-0033 fax
   * [EMAIL PROTECTED]
   * [EMAIL PROTECTED]


___
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] XML Content handling questions.

2005-05-27 Thread Andreas Jung

Zope itself has no native XML support. However there are some products like
ParsedXML that provide additional functionality. You might also look at 
Silva CMS

which is provides native XML support.

-aj

--On 27. Mai 2005 14:53:40 -0600 Nikko Wolf <[EMAIL PROTECTED]> 
wrote:



Three questions, in order of importance (to me):

1) Is it possible to validate an (uploaded) XML file against a schema
   (currently on the Zope server)?
What, if any, extra packages are needed?I want to use this in my
upload forms to alert the user if their files are invalid.

2) I also need to serve up web-based forms and allow the user to create
XML content based on a user-selected schema.  Something
like what Chiba (http://chiba.sf.net/) is targeting.   Of course,
though, that isn't a Python/Zope solution.  Has anyone seen anything
that works?  At this point, installing Tomcat and Chiba is what I
presume I'll be doing in a couple of weeks

3) Is there a function built-in to Zope that allows merging XML files?
(ie: all the  within a list of user-selected files).
I've got an Extension that works correctly (using the Amara/4Suite
packages), so an answer here is mostly for me to learn Zope better.


Thanks,
Nikko.

PS: I'm pretty new to Python & Zope, but not web servers or other
programming.

Server:
Fedora Core 3
Python 2.3.4
Zope 2.7.6-final
Plone 2.0.5
4Suite 1.0b1
Amara 1.0b2



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






pgp0qga7DYUCD.pgp
Description: PGP signature
___
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] DTML in Zope 2 vs Zope 3

2005-05-27 Thread Andrew Milton
+---[ Jonathan Cyr ]--
| Damn users, using all this imperfect software. These Kids Today!  ;-)
| 
| Easy Big Fella, Whooa.
| 

You must be new here We've all learnt to ignore Chris... 

He gets easily confused... or maybe he doesn't take his medication... not
sure, but, ignoring him generally works for the best d8)

-- 
Andrew Milton
[EMAIL PROTECTED]
___
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] DTML in Zope 2 vs Zope 3

2005-05-27 Thread Jonathan Cyr




Damn users, using all this
imperfect software. These Kids Today! 
;-) 

Easy Big Fella, Whooa.

-Jon



Chris Withers wrote:
Tino
Wildenhain wrote:
  
  Unfortunately Plone is still a bad example
for ZPT. It is getting

better but still it has a lot of code and definition in the templates.

Maybe AT would be a way out.

  
  
AT? As in ArcheTypes? You ARE kidding right? I've never seen such bad
code, and in particular, abuse of ZPT in my entire life...
  
  
And DTML sux, you wanna use it, fine, that says something about you.
Use ZClasses, Plone, AT and XUF at the same time while you're at it.
Why not dig out LoginManager and ZPatterns too, just for good measure?
  
  
Hell, why not just do us all a favour and switch to using Perl where
you'll be s much happier, and everyone in the community will agree
with you rather than trying to help you not shoot yourself in the foot
;-)
  
  
cheers,
  
  
Chris
  
  



___
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] Create a list using DTML.

2005-05-27 Thread Fernando Lujan
On 24/05/05, J Cameron Cooper <[EMAIL PROTECTED]> wrote:

> Personally, I'd probably just do something like::
>   "{1,2,3}"[1:-1].split(',')
 
This code works as expected... Thanks! :)

--
Fernando Lujan
___
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] XML Content handling questions.

2005-05-27 Thread Nikko Wolf

Three questions, in order of importance (to me):

1) Is it possible to validate an (uploaded) XML file against a schema
  (currently on the Zope server)?
   What, if any, extra packages are needed?I want to use this in my
   upload forms to alert the user if their files are invalid.

2) I also need to serve up web-based forms and allow the user to create
   XML content based on a user-selected schema.  Something
   like what Chiba (http://chiba.sf.net/) is targeting.   Of course,
   though, that isn't a Python/Zope solution.  Has anyone seen anything
   that works?  At this point, installing Tomcat and Chiba is what I
   presume I'll be doing in a couple of weeks

3) Is there a function built-in to Zope that allows merging XML files?
   (ie: all the  within a list of user-selected files).
   I've got an Extension that works correctly (using the Amara/4Suite
   packages), so an answer here is mostly for me to learn Zope better.


Thanks,
Nikko.

PS: I'm pretty new to Python & Zope, but not web servers or other
programming.

Server:
   Fedora Core 3
   Python 2.3.4
   Zope 2.7.6-final
   Plone 2.0.5
   4Suite 1.0b1
   Amara 1.0b2



___
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] Finding an object in a folder

2005-05-27 Thread Paul Winkler
On Tue, May 24, 2005 at 08:59:01PM +0200, Dieter Maurer wrote:
> An incredibly long time ago, I filed a feature request for
> "hasattr_unacquired" -- together with patch, unit tests and documentation
> update. 

Do you mean this?
http://www.zope.org/Collectors/Zope/742

the unit tests and docs are missing.
But I like the idea.

-- 

Paul Winkler
http://www.slinkp.com
___
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] Receiving mails

2005-05-27 Thread David H

Varun Parange wrote:


hi,
i have downloaded an SMTP server and using it i can send mails with 
the help of Zope MailHost
 
however i would also like to recieve mails how do i do this.

which additional products do i need to download...
 
regards,

varun
 

 


Varun,

I wrote a spam filter using wxpython - but all the incoming mail uses 
standard python libraries:  poplib, rfc822, email.Parser.  Just write an 
external python script to handle. 


David

___
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] Receiving mails

2005-05-27 Thread J Cameron Cooper

Varun Parange wrote:

i have downloaded an SMTP server and using it i can send mails with the 
help of Zope MailHost
 
however i would also like to recieve mails how do i do this.

which additional products do i need to download...


I recall some people talking about actually turning Zope into a mail 
server. Frankly, I think that's a little crazy, but it might work. You 
can search the list if you're interested.


A more common usage is to have a POP or IMAP server somewhere and use 
Zope as a client for that. There exist several products for doing 
webmail in Zope.


http://www.pentila.com/produits/WebMail/
http://plonewebmail.openprojects.it/

for instance.

--jcc

--
"Building Websites with Plone"
http://plonebook.packtpub.com/
___
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] Receiving mails

2005-05-27 Thread Varun Parange
hi,
i have downloaded an SMTP server and using it i can send mails with the help of Zope MailHost
 
however i would also like to recieve mails how do i do this.
which additional products do i need to download... 
 
regards,
varun
 __Do You Yahoo!?Tired of spam?  Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___
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] LDAPUserFolder at Zope root

2005-05-27 Thread J Cameron Cooper

Jens Vagelpohl wrote:


On May 26, 2005, at 22:34, J Cameron Cooper wrote:


Oscar Figueiredo wrote:


this might be trivial but I just can't find a way to do it.  How  
does one
replace the initial UserFolder at Zope root with a  LDAPUSerFolder ?  
I tried the dummy way : delete the acl_users  with an intent to 
instanciate a
LDAPUSerFolder afterwards but that locked me out in a way I could  do 
nothing

but recreate a new Zope instance...  skip-authentication-checking in
etc/zope.conf didn't help...



Do not do that. You don't want to get locked out of your Zope  because 
of LDAP problems.



The emergency user always works. You can't lock yourself out due to  
LDAP problems. If anyone sees a symptom like that on the current  
LDAPUserFolder version it will be fixed right away because it is a bug.


Yes, you can always break into Zope that way. But that's not something I 
would want to plan to do, especially when the alternative is so easy.


--jcc

--
"Building Websites with Plone"
http://plonebook.packtpub.com/
___
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] DTML in Zope 2 vs Zope 3

2005-05-27 Thread Greg Fischer
Ah you are right.  Just occured to me.  That is kind of a pain in
DTML, but I've learned how to deal with it.  Makes sense.

If I already have an object, say from a form submitted, in the REQUEST
namespace, and I then retrieve data from sql and a column has the same
name, I will have an issue.  Which one is going to display in my var?

I deal with this particular issue by changing my zsql method to return
the column name differently, but there are other times when this may
arise and it is a problem. And this causes you to have to do a bunch
of messy dtml-call REQUEST.set's to set your vars correctly.

I have learned how to deal with these things, but you are right, this
is a problem with DTML and I can see how this exact issue helps make
DTML messy and a little confusing.  Great point.  Thanks.

Greg

On 5/27/05, Lennart Regebro <[EMAIL PROTECTED]> wrote:
> On 5/27/05, Greg Fischer <[EMAIL PROTECTED]> wrote:
> > Well, aside from the fact that you cant use DTML in WYSIWYG editors, I
> > still dont understand why it is not good.
> 
> Well, the fact that you get everyting directly into the current
> namespace, especially with DTML-in, and things like that, is the real
> problem. But as noted, by making all data-gathering in a python
> script, the problems with this are less and survivable.
> 
> --
> Lennart Regebro, Nuxeo http://www.nuxeo.com/
> CPS Content Management http://www.cps-project.org/
> 


-- 
Greg Fischer
1st Byte Solutions
http://www.1stbyte.com
___
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] DTML in Zope 2 vs Zope 3

2005-05-27 Thread Lennart Regebro
On 5/27/05, Greg Fischer <[EMAIL PROTECTED]> wrote:
> Well, aside from the fact that you cant use DTML in WYSIWYG editors, I
> still dont understand why it is not good.  

Well, the fact that you get everyting directly into the current
namespace, especially with DTML-in, and things like that, is the real
problem. But as noted, by making all data-gathering in a python
script, the problems with this are less and survivable.

-- 
Lennart Regebro, Nuxeo http://www.nuxeo.com/
CPS Content Management http://www.cps-project.org/
___
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] Re: Opening .doc files in zope

2005-05-27 Thread Josef Meile
The short answer is "it depends".  To make such files generally available 
you have to convert them to HTML so arbirary browsers can access them.  
You can use MS Word to do the conversion.  If your Zope is running on a 
Windows machine that also has Word, you can manage the conversion 
dynamically using an External Method or a Product (which you'd have to 
write).  Alternatively, you could store the MS Word document in it's XML
form and use that to drive the rendering.   If you are not interested in 
general availability and you users are all running Windows with Word 
installed, you can configure IE, I believe, to render Word documents 
directly.

In addition, you could use the wmWare libraries to convert the word
files to html/pdf, but they don't work well with complicated word
documents. You can download there here:

http://wvware.sourceforge.net   -> linux
http://gnuwin32.sourceforge.net/packages/wv.htm -> Windows

Regards,
Josef

___
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] DTML in Zope 2 vs Zope 3

2005-05-27 Thread Greg Fischer
Using DTML from WYSIWYG editors is definitely a drawback.  But, how
many of us use them for doing our work?  I might use Dreamweaver to
clean up my sliced web template, but soon as I start my Zope work,
it's all Crimson Editor coding by hand to Zope.  Using Dreamweaver
actually slows me down, it's easier to just code it.  However, from a
newbie perspective, not being able to run my Zope content in my fancy,
drag'n'drop editor really bugged me a long time a go.

Saying DTML sucks is only stating your difference of oppinion.  At
least give us some insight as to why it sucks.  Technical, usability,
or even marketing reasons would be helpful.  But, come on DUH? 
Everybody will have their preference of languages, and even the way
they like to layout the code.  So I understand that some of us like
DTML and some dont.

All that aside, DTML may be ugly, but I dont agree.  I guess beauty is
in the eye of the beholder. :)

Well, aside from the fact that you cant use DTML in WYSIWYG editors, I
still dont understand why it is not good.  If it is simple, easy to
use, and it does the job, and I suppose, if you prefer it, why is it
not good to use?

I've beaten this subject to death, so time to move on.
Thanks for hearing me out.
Greg

On 5/27/05, Lennart Regebro <[EMAIL PROTECTED]> wrote:
> On 5/26/05, Greg Fischer <[EMAIL PROTECTED]> wrote:
> > Is DTML really that much harder to use?
> 
> Nah, but it's uglier. Also, the idea is that a web editor that
> confirms to the tsandard of ignoring things it doens't understand,
> should in theory be usable with TAL, but not with DTML. In practice,
> however, HTML editors don't do that.
> 
> > I understand the whole idea of separating the logic and the
> > presentation, and I guess, is that part of the reason why DTML is not
> > as good?
> 
> Well, it used to be. But logic crept into ZPTs as well. The good thing
> is to set up all the data in a python script or python method, and
> then use the template only to display this data. Zope3 has this
> separation "built-in", when you create a page with a template it
> automatically gets connected to a "view" which is a python class, and
> you can specify your own custom view and set up the data there.
> 
> In Zope 2 you have to call a script that creates the data, or
> reversely, use the script as the main view and let it call the
> template. (I don't know how easy that last thing is with DTML, but the
> first one works).
> 
> If you do this, the drawbacks of DTML becomes much less painful.
> --
> Lennart Regebro, Nuxeo http://www.nuxeo.com/
> CPS Content Management http://www.cps-project.org/
> 


-- 
Greg Fischer
1st Byte Solutions
http://www.1stbyte.com
___
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] Opening .doc files in zope

2005-05-27 Thread Dennis Allison
On Fri, 27 May 2005, Allen Huang wrote:

> Is there any way to open a .doc files using dtml or script and print them??
> 

The short answer is "it depends".  To make such files generally available 
you have to convert them to HTML so arbirary browsers can access them.  
You can use MS Word to do the conversion.  If your Zope is running on a 
Windows machine that also has Word, you can manage the conversion 
dynamically using an External Method or a Product (which you'd have to 
write).  Alternatively, you could store the MS Word document in it's XML
form and use that to drive the rendering.   If you are not interested in 
general availability and you users are all running Windows with Word 
installed, you can configure IE, I believe, to render Word documents 
directly.



___
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] Opening .doc files in zope

2005-05-27 Thread Allen Huang
Is there any way to open a .doc files using dtml or script and print them??
		Yahoo! Mail 
Stay connected, organized, and protected. Take the tour___
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] Saving the html-code

2005-05-27 Thread Flemming Bjerke
Fredag den 27. maj 2005 15:33 skrev Dieter Maurer:
> Flemming Bjerke wrote at 2005-5-27 11:20 +0200:
> >With a dtml-script I renders data from a mysql-database. But, sometimes I
> >should like to save the html-code generated by the script. When I try to
> > do this with a pythonscript I run into problems with acquiring the
> > html-code generated by the dtml-script. I looks like the dtml-script does
> > not get the proper namespace.
>
> Where do you want to store the result and why?
The actual use was to send the resulting html-file as attachment to 
maililnglist mails. 
>
> One of the easiest solutions would be caching (e.g. by
> a "RamCacheManager").
Well, then I must look at how. Thanks.

Flemming
___
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] Finding an object in a folder

2005-05-27 Thread Paul Winkler
On Fri, May 27, 2005 at 03:26:04PM +0200, Dieter Maurer wrote:
> A higher risk comes from the fact that some Python packages may
> rely on the broken "hasattr" behaviour. That's the reason why
> the problem is not fixed in Python itself.

And that's a very good reason not to monkeypatch it.
We can't have arbitrary third-party packages breaking when
they are used with Zope. Such bugs could be maddeningly difficult
to diagnose and find.

Anyway, Jim has made a papal edict on zope-dev:
We will never monkeypatch hasattr in the zope core.

-- 

Paul Winkler
http://www.slinkp.com
___
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] Finding an object in a folder

2005-05-27 Thread Paul Winkler
On Fri, May 27, 2005 at 01:58:44PM +0200, Florent Guillaume wrote:
> And all empty tuples are equal.

Not just equal, but all empty tuples are *identical*,
so () is () == True. 

I had no idea this was so :-\
 
> In python 2.3, the idiom most commonly found is to use marker = object().

Thanks for that.

-- 

Paul Winkler
http://www.slinkp.com
___
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] Finding an object in a folder

2005-05-27 Thread Dieter Maurer
Paul Winkler wrote at 2005-5-26 19:57 -0400:
> ...
>> >Make it so! :-)
>> 
>>   _marker = []
>>   def hasattr(obj, attr, marker):

I introduced a bug here (noticed by "Alec Mitchell").

The "marker" argument should have been "_marker=_marker".

> ...
>Are you currently running zope with a patch like this?

No, because I never really met an "hasattr" bug (although
I acknowledge that it may happen).

>Have you noticed any performance difference?
>the zope 2.6 source code contains over 700 calls to hasattr()...

We replace a small C-implemented function with a small Python one.
Although the Python function may be about 10 times slower,
the overall effect is almost surely negligible.

A higher risk comes from the fact that some Python packages may
rely on the broken "hasattr" behaviour. That's the reason why
the problem is not fixed in Python itself.

-- 
Dieter
___
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] Finding an object in a folder

2005-05-27 Thread Dieter Maurer
Paul Winkler wrote at 2005-5-27 05:07 -0400:
> ...
>What's wrong with a tuple? There's no reason to mutate the marker. 

The Python spec allows implementations to identify immutable objects
with the same value. Thus, in principle, two "()" created
at different times can in fact be the same object.
This would violate our use as a marker.

Python specifies that mutable objects created at different times
are garanteed to be different (as long as both exist).
Therefore, you can use them safely as markers.

-- 
Dieter
___
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] Uploading rst docs & Put_factory

2005-05-27 Thread Dieter Maurer
Andrew Malcolmson wrote at 2005-5-26 11:58 -0400:
>I want to upload a restructured text (rst) document to my Zope server 
>via FTP and have its content type recognized.  I understand that I need 
>to make an entry in PUT_factory.py but I need some guidance here.  The 
>following attempt didn't have any effect (that is, the type of the 
>uploaded file is still just 'text/plain'):
>
>elif typ.endswith('rst'):
>
>   ob= ReStructuredTextDocument(name)

Probably because the decision is already fixed before your
"elif" is reached (and then skipped).

-- 
Dieter
___
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] Saving the html-code

2005-05-27 Thread Dieter Maurer
Flemming Bjerke wrote at 2005-5-27 11:20 +0200:
>With a dtml-script I renders data from a mysql-database. But, sometimes I 
>should like to save the html-code generated by the script. When I try to do 
>this with a pythonscript I run into problems with acquiring the html-code 
>generated by the dtml-script. I looks like the dtml-script does not get the 
>proper namespace. 

Where do you want to store the result and why?

One of the easiest solutions would be caching (e.g. by
a "RamCacheManager").


-- 
Dieter
___
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] Namespace for PythonScript

2005-05-27 Thread Dieter Maurer
Hong Yuan wrote at 2005-5-27 00:07 +0800:
>If a PythonScript is called from a Page Template, how can it access the 
>variables defined using:
>   
>in the calling script?

It may work to bind the "namespace" binding.

Not sure, though...

-- 
Dieter
___
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] Re: Finding an object in a folder

2005-05-27 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Paul Winkler wrote:
> On Fri, May 27, 2005 at 08:51:58AM +0100, Chris Withers wrote:
> 
>>Paul Winkler wrote:
>>
>>
>>>marker = ()
>>>if getattr(some_object, marker) is not marker:
>>
>>For good measure, I wonder if that should be a [], no a ()?
> 
> 
> What's wrong with a tuple? There's no reason to mutate the marker. 

In Python, there is only empty tuple object,  while each empty list is a
distinct object.  For use as a marker, the empty list can't return a
false positive, while the empty tuple can.

Tres.
- --
===
Tres Seaver   [EMAIL PROTECTED]
Palladion Software   "Excellence by Design"http://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFClw9J+gerLs4ltQ4RAtyCAJ4y+h+rDtSmo+Sa2n5K+h87z/24DwCgwBFY
9Wrhk9aGMBUPm1DxsOpewec=
=O5re
-END PGP SIGNATURE-

___
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] Finding an object in a folder

2005-05-27 Thread Florent Guillaume
Paul Winkler  <[EMAIL PROTECTED]> wrote:
> On Fri, May 27, 2005 at 08:51:58AM +0100, Chris Withers wrote:
> > Paul Winkler wrote:
> > 
> > >marker = ()
> > >if getattr(some_object, marker) is not marker:
> > 
> > For good measure, I wonder if that should be a [], no a ()?
> 
> What's wrong with a tuple? There's no reason to mutate the marker. 

The whole point of a marker is that it is unique, so cannot be confused
with a legitimate value of the object examined.

And all empty tuples are equal.

In python 2.3, the idiom most commonly found is to use marker = object().

Florent

-- 
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of R&D
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
___
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] Zope MailHost Query

2005-05-27 Thread Tino Wildenhain
Am Freitag, den 27.05.2005, 12:32 +0200 schrieb Andreas Jung:
> 
> --On Freitag, 27. Mai 2005 3:15 Uhr -0700 Varun Parange 
> <[EMAIL PROTECTED]> wrote:
> 
> > hi,
> >
> >  how do i receive mails using Zope mailhost??
> 
> MailHost is only for *sending* but not for receiving mails. Zope is *not* 
> an SMTP server.

But there is a currently not very good documented smtp-server
for zope. 

http://dev.legco.biz/products/smtpservice


-- 
Tino Wildenhain <[EMAIL PROTECTED]>

___
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] Zope MailHost Query

2005-05-27 Thread Andreas Jung



--On Freitag, 27. Mai 2005 3:15 Uhr -0700 Varun Parange 
<[EMAIL PROTECTED]> wrote:



hi,

 how do i receive mails using Zope mailhost??


MailHost is only for *sending* but not for receiving mails. Zope is *not* 
an SMTP server.


-aj




pgpSF9JJiUCyr.pgp
Description: PGP signature
___
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] Zope MailHost Query

2005-05-27 Thread Varun Parange
hi, 
 
 how do i receive mails using Zope mailhost??
 
		Do You Yahoo!? Yahoo! Small Business - Try our new Resources site!___
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] DTML in Zope 2 vs Zope 3

2005-05-27 Thread Lennart Regebro
On 5/26/05, Greg Fischer <[EMAIL PROTECTED]> wrote:
> Is DTML really that much harder to use?

Nah, but it's uglier. Also, the idea is that a web editor that
confirms to the tsandard of ignoring things it doens't understand,
should in theory be usable with TAL, but not with DTML. In practice,
however, HTML editors don't do that.

> I understand the whole idea of separating the logic and the
> presentation, and I guess, is that part of the reason why DTML is not
> as good?  

Well, it used to be. But logic crept into ZPTs as well. The good thing
is to set up all the data in a python script or python method, and
then use the template only to display this data. Zope3 has this
separation "built-in", when you create a page with a template it
automatically gets connected to a "view" which is a python class, and
you can specify your own custom view and set up the data there.

In Zope 2 you have to call a script that creates the data, or
reversely, use the script as the main view and let it call the
template. (I don't know how easy that last thing is with DTML, but the
first one works).

If you do this, the drawbacks of DTML becomes much less painful.
-- 
Lennart Regebro, Nuxeo http://www.nuxeo.com/
CPS Content Management http://www.cps-project.org/
___
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] LDAPUserFolder at Zope root

2005-05-27 Thread Jens Vagelpohl


On May 26, 2005, at 22:34, J Cameron Cooper wrote:


Oscar Figueiredo wrote:


this might be trivial but I just can't find a way to do it.  How  
does one
replace the initial UserFolder at Zope root with a  
LDAPUSerFolder ?  I tried the dummy way : delete the acl_users  
with an intent to instanciate a
LDAPUSerFolder afterwards but that locked me out in a way I could  
do nothing

but recreate a new Zope instance...  skip-authentication-checking in
etc/zope.conf didn't help...



Do not do that. You don't want to get locked out of your Zope  
because of LDAP problems.


The emergency user always works. You can't lock yourself out due to  
LDAP problems. If anyone sees a symptom like that on the current  
LDAPUserFolder version it will be fixed right away because it is a bug.


jens

___
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] Saving the html-code

2005-05-27 Thread Flemming Bjerke
With a dtml-script I renders data from a mysql-database. But, sometimes I 
should like to save the html-code generated by the script. When I try to do 
this with a pythonscript I run into problems with acquiring the html-code 
generated by the dtml-script. I looks like the dtml-script does not get the 
proper namespace. 

How do I solve this?

Flemming

___
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] Finding an object in a folder

2005-05-27 Thread Paul Winkler
On Fri, May 27, 2005 at 08:51:58AM +0100, Chris Withers wrote:
> Paul Winkler wrote:
> 
> >marker = ()
> >if getattr(some_object, marker) is not marker:
> 
> For good measure, I wonder if that should be a [], no a ()?

What's wrong with a tuple? There's no reason to mutate the marker. 

-- 

Paul Winkler
http://www.slinkp.com
___
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] DTML in Zope 2 vs Zope 3

2005-05-27 Thread Hugo Ramos
On 5/27/05, Chris Withers <[EMAIL PROTECTED]> wrote:
> AT? As in ArcheTypes? You ARE kidding right? I've never seen such bad
> code, and in particular, abuse of ZPT in my entire life...
> 
> And DTML sux, you wanna use it, fine, that says something about you. Use
> ZClasses, Plone, AT and XUF at the same time while you're at it. Why not
> dig out LoginManager and ZPatterns too, just for good measure?
> 
> Hell, why not just do us all a favour and switch to using Perl where
> you'll be s much happier, and everyone in the community will agree
> with you rather than trying to help you not shoot yourself in the foot ;-)

Is it me or are you really pissed??? :-)
At least give DTML some credit... It's what made Zope so popular in
the first days because of easy and fast learning curve!!!

Regards
Hugo

-- 
Hugo Ramos - [EMAIL PROTECTED]
___
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] UnicodeDecodeError

2005-05-27 Thread Chris Withers

Dieter Maurer wrote:

  Only the default is "latin-1" (as specified by the HTML
  specification).


Indeed, but that should be configurable...

Chris

--
Simplistix - Content Management, Zope & Python Consulting
   - http://www.simplistix.co.uk

___
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] DTML in Zope 2 vs Zope 3

2005-05-27 Thread Chris Withers

Tino Wildenhain wrote:

Unfortunately Plone is still a bad example for ZPT. It is getting
better but still it has a lot of code and definition in the templates.
Maybe AT would be a way out.


AT? As in ArcheTypes? You ARE kidding right? I've never seen such bad 
code, and in particular, abuse of ZPT in my entire life...


And DTML sux, you wanna use it, fine, that says something about you. Use 
ZClasses, Plone, AT and XUF at the same time while you're at it. Why not 
dig out LoginManager and ZPatterns too, just for good measure?


Hell, why not just do us all a favour and switch to using Perl where 
you'll be s much happier, and everyone in the community will agree 
with you rather than trying to help you not shoot yourself in the foot ;-)


cheers,

Chris

--
Simplistix - Content Management, Zope & Python Consulting
   - http://www.simplistix.co.uk

___
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] Finding an object in a folder

2005-05-27 Thread Chris Withers

Paul Winkler wrote:


marker = ()
if getattr(some_object, marker) is not marker:


For good measure, I wonder if that should be a [], no a ()?

cheers,

Chris

--
Simplistix - Content Management, Zope & Python Consulting
   - http://www.simplistix.co.uk

___
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] DTML in Zope 2 vs Zope 3

2005-05-27 Thread Greg Fischer
Wow, thanks for the replies guys.  It's good to hear I am not the only
one who likes DTML.

Tino, thanks for the explanations.  I have some thoughts below on
that, and keep in mind, I am questioning from my own ignorance.

Tino Wrote:
> The major drawbacks of DTML are:
> 
> - one namespace (with transparent layers)  
One namespace?  Why do you need more?  I havent had any problems with
one.  Can you give some examples of why this is important or how it
would be useful?

> - confusing naming of tags, like  which
>   really is  or something
Well I realize that it could be named something else, but it never
occured to me.  I dont think it's confusing.  I mean, in DTML you use
4 tags more than any other, IN, VAR, IF, and CALL.  Simple.  And if
there is one thing I have learned over the few years I have been
programming, it is to keep it simple. Simple works.

> - and the extra tags for flow control, but probably
>   the dtml fans can live with it.
Yeah, simple.  We can live with it, particularly since we can call
more detailed functionality from Python.

> - peoples practice to use  even inside
>   html-tags attributes, where &dtml-foo; should be used.
Hmm.. Never thought of that one as I too just use the full .  I can see now that it might make readability a little better to
use &dtml, but is there a technical reason for using it that way?

Thank you again for your input Tino.  I can understand the need to
take Zope to another level, its the nature of things to keep them
growing.  And changing Zope to fit the needs of large scale
applications is good, I just hate to see the sacrifice of the smaller
apps needs.  I probably will never get to work on enterprise class
systems, in fact I really dont want to, but Zope works beautifully for
the small web apps and that's what I want to work on.  I wonder what
the ratio is of Zope users who use small apps to those who do large
apps?

Thanks again!

Greg

On 5/26/05, Tino Wildenhain <[EMAIL PROTECTED]> wrote:
> Am Freitag, den 27.05.2005, 00:20 +0200 schrieb Jaroslav Lukesh:
> ...
> > I absolutelly agree with you, it is like my words.
> >
> > But separation of logic and presentation could be done successfully in DTML
> > too. ZPT, which have "separation argument" is not as easy to make totally
> 
> This is even somewhat correct. If people had the discipline to not abuse
> the templating to do complicated logic.
> The major drawbacks of DTML are:
> 
> - one namespace (with transparent layers)
> - confusing naming of tags, like  which
>   really is  or something
> - and the extra tags for flow control, but probably
>   the dtml fans can live with it.
> - peoples practice to use  even inside
>   html-tags attributes, where &dtml-foo; should be used.
> 
> > separated design as marketing says, for example see Plone - try to customize
> > plone site to absolutelly different custom design - it is near impossible.
> 
> Unfortunately Plone is still a bad example for ZPT. It is getting
> better but still it has a lot of code and definition in the templates.
> Maybe AT would be a way out.
> 
> ___
> 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 )
> 


-- 
Greg Fischer
1st Byte Solutions
http://www.1stbyte.com
___
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 )