Re: [Zope-dev] Profiling Products

2001-02-08 Thread Andy Dawkins

Martijn Pieters wrote:
 Have a look at: Control Panel - Debug Information. There is a 'Profiling'
 tab that explains what you have to do to switch it on.
 
 --
 Martijn Pieters

Oh my god, That is so sexy

:-)

Cheers Martijn, I owe you a pint.

-Andy

___
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] Stop words/vocabulary

2001-02-08 Thread Arno Gross

Can I apply stop words in a ZCatalog?
Are there stop words for german available?
If not I would try to compose a stop word list for german
and publish it.

Thanks 
   Arno Gross, [EMAIL PROTECTED]

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



[Zope-dev] ZCatalog/TextIndex/OR - keyword search

2001-02-08 Thread Arno Gross

I understand that the search terms for a field with TextIndex are ORed
and the fields in a search form are ANDed.
But assume the following:
 * I have three fields (eg. abstract, content, title) with TextIndex
 * I have one field (eg. category) with FieldIndex

When searching I want just give a keyword for the three TextIndex fields
and a search term for category.
The applying expression should look like this:

(abstract=keyword OR content=keyword OR title=keyword) AND
category=searchTerm

Any hints?
Thanks 
   Arno Gross, email: [EMAIL PROTECTED]

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



Re: [Zope-dev] ZCatalog/TextIndex/OR - keyword search

2001-02-08 Thread Steve Alexander

Arno Gross wrote:

 I understand that the search terms for a field with TextIndex are ORed
 and the fields in a search form are ANDed.
 But assume the following:
  * I have three fields (eg. abstract, content, title) with TextIndex
  * I have one field (eg. category) with FieldIndex
 
 When searching I want just give a keyword for the three TextIndex fields
 and a search term for category.
 The applying expression should look like this:
 
 (abstract=keyword OR content=keyword OR title=keyword) AND
 category=searchTerm
 
 Any hints?

Create a method or computed attribute called "search_text" that returns the
concatenation of abstract, content and title.

In ZPatterns I'd use the following SkinScript:

  WITH SELF COMPUTE
search_text='%s %s %s' % (abstract, content, title)

An equivalent PythonScript as a method of your ZClass would be:

name: search_text
  return '%s %s %s' % (container.abstract, container.content, container.title)

Use a similar method in a python class, replacing "container" with "self".

Set up search_text as a TextIndex in your ZCatalog.

Then, query the catalog with something like:

  Catalog(search_text=keyword_for_query, category=searchTerm)

The standard name for the search_text method or attribute is
PrincipiaSearchSource. That's why PrincipiaSearchSource is a default
TextIndex in a new ZCatalog.

--
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.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 )



[Zope-dev] More Python Script Wishlist

2001-02-08 Thread Chris Withers

I wish I could do:

from ZPublisher import Client
return Client.call(url,username,password)[1]

...in a python script.

Why would that be insecure?

cheers,

Chris

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



Re: [Zope-dev] ZCatalog/TextIndex/OR - keyword search

2001-02-08 Thread Arno Gross

Hi Steve,
maybe I'm missing one step. If I create a TextIndex for search_text (or
PrincipiaSearchSource)
I have to tell somewhere how this index is composite? Becaus I try to
list PrincipiaSearchSource in my result list it's empty.
Thanks
   Arno Gross, email: [EMAIL PROTECTED]
On Thu, 08 Feb 2001, Steve Alexander wrote:
 Arno Gross wrote:
 
  I understand that the search terms for a field with TextIndex are ORed
  and the fields in a search form are ANDed.
  But assume the following:
   * I have three fields (eg. abstract, content, title) with TextIndex
   * I have one field (eg. category) with FieldIndex
  
  When searching I want just give a keyword for the three TextIndex fields
  and a search term for category.
  The applying expression should look like this:
  
  (abstract=keyword OR content=keyword OR title=keyword) AND
  category=searchTerm
  
  Any hints?
 
 Create a method or computed attribute called "search_text" that returns the
 concatenation of abstract, content and title.
 
 In ZPatterns I'd use the following SkinScript:
 
   WITH SELF COMPUTE
 search_text='%s %s %s' % (abstract, content, title)
 
 An equivalent PythonScript as a method of your ZClass would be:
 
 name: search_text
   return '%s %s %s' % (container.abstract, container.content, container.title)
 
 Use a similar method in a python class, replacing "container" with "self".
 
 Set up search_text as a TextIndex in your ZCatalog.
 
 Then, query the catalog with something like:
 
   Catalog(search_text=keyword_for_query, category=searchTerm)
 
 The standard name for the search_text method or attribute is
 PrincipiaSearchSource. That's why PrincipiaSearchSource is a default
 TextIndex in a new ZCatalog.
 
 --
 Steve Alexander
 Software Engineer
 Cat-Box limited
 http://www.cat-box.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 )

___
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] ZSQL using LIKE operator

2001-02-08 Thread Jens Vagelpohl

just write it out like:

SELECT * FROM table WHERE keywords LIKE '%dtml-var name="my_var"%'

jens


on 2/8/01 7:17, Schmidt, Allen J. at [EMAIL PROTECTED] wrote:

 I have been through the docs, searched a variety of locations, and cannot
 find anything on how to resolve a query which I need to read:
 
 SELECT * FROM table WHERE keywords LIKE '%keywords_variable%'
 
 dtml-sqltest has 'op=like' and when set to 'type=string' produces the LIKE
 operation in the query, with single quotes,  but I cannot get it to 'wrap'
 the keywords with the percent characters and THEN the single quotes to
 produce that which I have in the query above.
 
 Ideally what I need to produce would be the query to search through some
 text in several fields by the keyword_variable (IF any keywords are
 provided) AND/OR within  a specific category of information. If I can get
 the syntax to solve the above situation I think I can get dtml-sqlgroup to
 sort out what information is provided and construct the query accordingly.
 
 Sorry for the length of this newbie question but I am stumped on this one.
 And, so ends my lurking status.
 
 Thanks!
 Allen
 
 ___
 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 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] Possible 'bad' with Client.py and urllib

2001-02-08 Thread Chris Withers

Hi,

Both urllib and Client.py can be used to get stuff from other sites via HTTP and
do useful stuff with it, right?

Well, I was doing this and I think I've found what could be a 'real bad
problem'.

It appears that both of the above block while getting stuff from the remote
site. Worse than that, they don't only block their current thread, they seem to
block _all_ the Zope threads.

The reason I say that is I ended up in a situation where I was using Client.py
to get something from the Zope server on which Client.py was running. Because of
the above, it effectively blocked the whole Zope server until the Client.py bit
timed out.

Does any of this make any sense to anyone?
Is there a thread-safe equivalent of Client.py and/or urllib.open?
Kindof related, is there any way to set the HTTP timeout when getting stuff
using either approach?

cheers for any help,

Chris

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



[Zope-dev] DAV locking in management interface

2001-02-08 Thread Steve Alexander

Now that DAV locking has landed, how about integrating it with the TTW 
management interface.

For example, when editing a DTML Method, have a button that says "Lock 
to make changes". Pressing this locks the method you want to edit. It 
gets unlocked when you press the "change" button.

--
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.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 )



[Zope-dev] strange problem with LoginManager

2001-02-08 Thread Tim McLaughlin

I am using LoginManager as specified by by dlpierson's HOWTO and everything
works fine unless somebody connects via ATT Worldnet (using a dialup).  In
this case, the browser displays a 404 error when the login page should be
shown.  Same machine connected through a LAN works fine, but again connected
through Worldnet is a no go.  I suspect this has something (maybe) to do
with Worldnet's proxies (if they have them) not handling the headers which
zope may (or may not) send.  Ok, so it's a guess please help.

Thanks.
Tim McLaughlin

___
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] manage_options in 2.3

2001-02-08 Thread Brian Lloyd

 Thanks for the new management interface guys I happily wrote a
 product last
 night and did a quick interface using the standard Folder interface and
 fiddled with filtered_meta_types list and dontAllowCutandPaste
 and so on. A
 quick How-To will be on its way. I got a wierd error trying to fiddle with
 manage_options though, in the olden days something like this worked:

 manage_options = (
 ( Folder.manage_options[0], ) +
 ( {'label':'View', 'action':'my_index_html', ) +
 ( Folder.manage_options[2:], )
 )


Dunno if this is the actual problem or just a typo in the
email:

 manage_options = (
 ( Folder.manage_options[0], ) +
 ( {'label':'View', 'action':'my_index_html', ) +
^ need to close dict
w/ }

I suspect its an email typo, though (I would have expected a
SyntaxError, unless it was being consumed somehow).

Brian Lloyd[EMAIL PROTECTED]
Software Engineer  540.371.6909
Digital Creations  http://www.digicool.com





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



Re: [Zope-dev] ZCatalog/TextIndex/OR - keyword search

2001-02-08 Thread Arno Gross

Steve, thanks for your hints.
At moment I'm working with  version 2.2.3 and could't bring it to work. Should
it work?
So I switched now tho 2.3 and after some struggles it works.
Actually I have ZClass objects.
Best regards
  Arno Gross, [EMAIL PROTECTED]

On Thu, 08 Feb 2001, Steve Alexander wrote:
 Arno Gross wrote:
 
  Hi Steve,
  maybe I'm missing one step. If I create a TextIndex for search_text (or
  PrincipiaSearchSource)
  I have to tell somewhere how this index is composite? Becaus I try to
  list PrincipiaSearchSource in my result list it's empty.
 
 You need to provide a method or property or attribute that gives the catalog the 
concatenated search text.
 
 You haven't said what kind of objects you are cataloging: are they ZClass instances, 
Python class instances, DTML Documents... ?
 
 You may be able to use a PythonScript in the acquisition path of your objects to do 
this work.
 

___
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] Zope dumping core

2001-02-08 Thread Dario Lopez-Kästen

Hello!

I am runing zope 2.2.5 on a Solaris box, and it is dumping core (suspect:
SQL MEthods with oracle, FTP server).

I am using it in conjunction with oracle. Could this be the culprit?

Any help is appreciated. If we cannot get Zope to be stable we'll have to
abandon it; this is not on my list of preferred actions, but we have very
little in zope at the moment, jet it is unstable. We'll soon need to start
moving to production and more heavy testing.

DC: what do you charge for technical support? Contact me off list, please.

Do any of you have any hints on how to track down the source of the failing.
AFAIK I have set up everything to log as much as possible, but there is no
hint of anythin in the logs. Also I don't know how to read the logs. I'll
poke around the sources, but if anyone has some info they'd like to share,
i'd appreciate it a lot.

Sincerely,

/dario

- 
Dario Lopez-Ksten Systems Developer  Chalmers Univ. of Technology
[EMAIL PROTECTED]  ICQ will yield no hitsIT Systems  Services


___
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: [Zope] Zope dumping core

2001-02-08 Thread Chris McDonough

You might want to take a look into the -M switch of z2.py in combination
with the "How To Track Down Hangs Using the Debug Log" HOWTO on Zope.org to
figure out where you're getting the coredump...


- Original Message -
From: "Dario Lopez-Ksten" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, February 08, 2001 10:23 AM
Subject: [Zope] Zope dumping core


 Hello!

 I am runing zope 2.2.5 on a Solaris box, and it is dumping core (suspect:
 SQL MEthods with oracle, FTP server).

 I am using it in conjunction with oracle. Could this be the culprit?

 Any help is appreciated. If we cannot get Zope to be stable we'll have to
 abandon it; this is not on my list of preferred actions, but we have very
 little in zope at the moment, jet it is unstable. We'll soon need to star=
 t
 moving to production and more heavy testing.

 DC: what do you charge for technical support? Contact me off list, please.

 Do any of you have any hints on how to track down the source of the faili=
 ng.
 AFAIK I have set up everything to log as much as possible, but there is n=
 o
 hint of anythin in the logs. Also I don't know how to read the logs. I'll
 poke around the sources, but if anyone has some info they'd like to share=
 ,
 i'd appreciate it a lot.

 Sincerely,

 /dario

 - 
 Dario Lopez-K=E4sten Systems Developer  Chalmers Univ. of Technology
 [EMAIL PROTECTED]  ICQ will yield no hitsIT Systems  Services


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



___
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] ZCatalog/TextIndex/OR - keyword search

2001-02-08 Thread Steve Alexander

Arno Gross wrote:

 Steve, thanks for your hints.
 At moment I'm working with  version 2.2.3 and could't bring it to work. Should
 it work?

PythonScripts won't work. You should be able to do it with an External Method. I don't 
know about PythonMethods.

 So I switched now tho 2.3 and after some struggles it works.

Great!

 Actually I have ZClass objects.

--
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.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] ZSQL using LIKE operator

2001-02-08 Thread Schmidt, Allen J.

Yup...You're right. I found an item that had a single quote in it. I tried
it and the query blew up. then I added parts you suggest, and bingo...works
fine.

Thanks!

To get around another problem I noticed...
I have a keywords text field to search through everything in every category.
On the same page, I have links which pass on the category number to the ZSQL
method.
The keywords FORM uses a hidden category field which I set to =""  -- worked
fine.
But if I used the URL to jump right to the category listings, there was no
keyword to pass.
I just set an empty property named 'keywords' and then if the URL search is
used, keywords has a 'value'. 
I am sure there is a more elegant way to do this..but it works fine.

Thanks again guys!

Allen

-Original Message-
From: Casey Duncan [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 08, 2001 11:11 AM
To: Jens Vagelpohl
Cc: Schmidt, Allen J.; [EMAIL PROTECTED]
Subject: Re: [Zope-dev] ZSQL using LIKE operator


Jens Vagelpohl wrote:
 
 just write it out like:
 
 SELECT * FROM table WHERE keywords LIKE '%dtml-var name="my_var"%'
 
 jens
 
 on 2/8/01 7:17, Schmidt, Allen J. at [EMAIL PROTECTED] wrote:
 
  I have been through the docs, searched a variety of locations, and
cannot
  find anything on how to resolve a query which I need to read:
 
  SELECT * FROM table WHERE keywords LIKE '%keywords_variable%'
 
  dtml-sqltest has 'op=like' and when set to 'type=string' produces the
LIKE
  operation in the query, with single quotes,  but I cannot get it to
'wrap'
  the keywords with the percent characters and THEN the single quotes to
  produce that which I have in the query above.
 
  Ideally what I need to produce would be the query to search through some
  text in several fields by the keyword_variable (IF any keywords are
  provided) AND/OR within  a specific category of information. If I can
get
  the syntax to solve the above situation I think I can get
dtml-sqlgroup to
  sort out what information is provided and construct the query
accordingly.
 
  Sorry for the length of this newbie question but I am stumped on this
one.
  And, so ends my lurking status.
 
  Thanks!
  Allen
 

SELECT * FROM table WHERE keywords LIKE '%dtml-var name="my_var"
sql_quote%'

would be a safer bet. Otherwise a value of my_var with a single quote in
it wouldn't work.
-- 
| Casey Duncan
| Kaivo, Inc.
| [EMAIL PROTECTED]
`--

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



Re: [Zope-dev] manage_options in 2.3

2001-02-08 Thread Andy McKay

Doh, I that was an email typo I would have received a syntax error (I always
run a syntax check prior to trying code, just not putting it in emails).
Anyway I checked it again and it occurs on Zope 2.2.5, so the its a not a
2.3. The problem is the [2:] which for some reason doesnt want to work, when
I thought I was accesing a simple tuple.

Sorry to bother you.

--
  Andy McKay.


- Original Message -
From: "Brian Lloyd" [EMAIL PROTECTED]
To: "Andy McKay" [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, February 08, 2001 7:17 AM
Subject: RE: [Zope-dev] manage_options in 2.3


  Thanks for the new management interface guys I happily wrote a
  product last
  night and did a quick interface using the standard Folder interface and
  fiddled with filtered_meta_types list and dontAllowCutandPaste
  and so on. A
  quick How-To will be on its way. I got a wierd error trying to fiddle
with
  manage_options though, in the olden days something like this worked:
 
  manage_options = (
  ( Folder.manage_options[0], ) +
  ( {'label':'View', 'action':'my_index_html', ) +
  ( Folder.manage_options[2:], )
  )
 

 Dunno if this is the actual problem or just a typo in the
 email:

  manage_options = (
  ( Folder.manage_options[0], ) +
  ( {'label':'View', 'action':'my_index_html', ) +
 ^ need to close dict
 w/ }

 I suspect its an email typo, though (I would have expected a
 SyntaxError, unless it was being consumed somehow).

 Brian Lloyd[EMAIL PROTECTED]
 Software Engineer  540.371.6909
 Digital Creations  http://www.digicool.com






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



Re: [Zope-dev] manage_options in 2.3

2001-02-08 Thread Andy McKay

Yes you can:

ActivePython 2.0, build 202 (ActiveState Tool Corp.)
based on Python 2.0 (#8, Oct 19 2000, 11:30:05) [MSC
Type "copyright", "credits" or "license" for more in
 a = ('a','b','c','d')
 print type(a)
type 'tuple'
 b = a[1:]
 print b
('b', 'c', 'd')
 print type(b)
type 'tuple'


--
  Andy McKay.


- Original Message -
From: "Chris Withers" [EMAIL PROTECTED]
To: "Andy McKay" [EMAIL PROTECTED]; "Brian Lloyd" [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, February 08, 2001 10:18 AM
Subject: Re: [Zope-dev] manage_options in 2.3


  2.3. The problem is the [2:] which for some reason doesnt want to work,
 when
  I thought I was accesing a simple tuple.

 You can't slice tuples, IIRC, which would explain why that bit fails.

 cheers,

 Chris




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



[Zope-dev] Subproducts in a Zope Python Product

2001-02-08 Thread Johan Carlsson

Hi,

I want to create a sub modul in one of my Python Products,
because it gets more manageble.
Accualy I have a bunch of Plugins I which files I want to manage
in sub directories of the original Python Product.

e.g. ./Products/MyProduct/PluginKind1 etc...

How do I setup the Zope registration procedure.
I just had a look at ZPattern and the only thing 
it seem I have to do is import the module form MyProducts __ini__.py

Is this assuption correct?

Regards,
Johan Carlsson

By the way.
Are there any reasons I shouldn't use necesting Plugins (Plugins that
can have Plugins)?





___
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] manage_options in 2.3

2001-02-08 Thread Andy McKay

If ActivePython is "un-normal" python, then yes "normal" python behaves like
that too. :)
--
  Andy McKay.


- Original Message -
From: "Chris Withers" [EMAIL PROTECTED]
To: "Andy McKay" [EMAIL PROTECTED]; "Brian Lloyd" [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, February 08, 2001 11:10 AM
Subject: Re: [Zope-dev] manage_options in 2.3


  ActivePython 2.0, build 202 (ActiveState Tool Corp.)
  based on Python 2.0 (#8, Oct 19 2000, 11:30:05) [MSC
  Type "copyright", "credits" or "license" for more in
   a = ('a','b','c','d')
   print type(a)
  type 'tuple'
   b = a[1:]
   print b
  ('b', 'c', 'd')

 Hmmm... does 'normal' python work like that too? Probably...

 Ah well, you learn something new every day :-)

 thanks,

 Chris




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



Bad: Re: [Zope-dev] ZSQL using LIKE operator

2001-02-08 Thread Jon Franz

No, this is bad!! Do NOT do this - it will allow Bad characters in your SQL
query that could allow mischievous people to tamper with your Db and
possibly hack your box
(depending upon what DB you are using, how it is configured, what user it
runs as, etc)
This is the whole reason the dtml-sqlvar tag exists - _Safe_ conversion to
formats usable by 
your DB, including escaping of bad characters.

instead, do This:

SELECT * FROM table WHERE keywords LIKE dtml-sqlvar "'%' + my_var + '%'"
type=string

the expression inside the quotes will handle adding the %'s to the beginning
and end of your string.

Sorry about the correction, but this Can be a big security hazard...

~Jon Franz/'Coventry': http://www.zope.org/Members/Coventry

Message: 9
Date: Thu, 08 Feb 2001 07:32:48 -0500
Subject: Re: [Zope-dev] ZSQL using LIKE operator
From: Jens Vagelpohl [EMAIL PROTECTED]
To: "Schmidt, Allen J." [EMAIL PROTECTED], [EMAIL PROTECTED]

just write it out like:

SELECT * FROM table WHERE keywords LIKE '%dtml-var name="my_var"%'

jens


___
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] Possible 'bad' with Client.py and urllib

2001-02-08 Thread Dieter Maurer

Chris Withers writes:
   urllib  Client block Zope 
That would suggest a bug in Python's socket implementation:

  its "makefile().read" method would not release the global
  interpreter lock.

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 )



Re: [Zope-dev] ZSQL using LIKE operator

2001-02-08 Thread Dieter Maurer

Schmidt, Allen J. writes:
   how to resolve a query which I need to read:
  
  SELECT * FROM table WHERE keywords LIKE '%keywords_variable%'
  
  dtml-sqltest has 'op=like' and when set to 'type=string' produces the LIKE
  operation in the query, with single quotes,  but I cannot get it to 'wrap'
  the keywords with the percent characters and THEN the single quotes to
  produce that which I have in the query above.
dtml-sqltest expr="'%%%s%%' % keywords_variable" column=keywords_variable ...


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 )



Re: [Zope-dev] Zope newbie question

2001-02-08 Thread Dieter Maurer

Bryan Baszczewski writes:
  Within my dtml, I am retrieving a text field from a database and passing
  this field to a javascript function.  However, the text field can be any
  length of characters and dtml keeps cutting the text off at no pre-set limit
  making it impossible to pass this field to javascript.  The javascript is
  going to take this text and pop it up in another window for the user to
  read.
DTML does not cut text, unless you tell it to do with the
"size" attribute.

  I checked the html source and everything looks fine, but when I execute it
  gives an "unterminated string" error.  Could Zope be causing this?
That sounds strange.
Unterminated string errors might be non local.
Maybe, the problem is much earlier in your code, a missing
or extraneous quote.

Are you sure your text from the database does not contain
unescaped quotes?


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] Object decision from WebDav/FTP

2001-02-08 Thread Andy McKay

Where does Zope do the decision to turn an file sent via FTP or WebDAV into
an object of a certain type? I want to fiddle with this so an image put via
WebDAV is a myImage object (for example) rather than an Image

Cheers.
--
  Andy McKay.




___
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] Zope dumping core

2001-02-08 Thread Dieter Maurer

Dario Lopez-Ksten writes:
  I am runing zope 2.2.5 on a Solaris box, and it is dumping core (suspect:
  SQL MEthods with oracle, FTP server).
  
  I am using it in conjunction with oracle. Could this be the culprit?
We have had that behaviour when we used an old DCOracle
to connect to an Oracle 8.1.6 server:

  The oracle client library cause a memory corruption
  that brought our Zope down about every 5 to 10 minutes.

Our problem disappears after we installed a newer DCOracle.


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] Storing part of an object on the file system

2001-02-08 Thread Andy McKay

Ok whack idea #34... Well sort of, the idea was sparked by ExtFile (yes its
all his fault honest). We want to have files on the file system for many
reasons which I won't go into now, just take it for granted. But we also
want some of the objects information to be in the standard data.fs, so we
can catalog it use acquisition provide a simple interface to it and so on.
So far you are saying thats ExtFile and you are right.

But we want to extend it to any object anywhere, instead of storing the data
attribute in the object and pickling it in the ZODB I want to be able to
store the data attribute on the file system. This gives us loads of
advantages we also thought this would be extremely useful to other people.
We've bounced around ideas on how to do this and here the only two so far:

-we could overload the data attribute with a class that on Pickling into
the ZODB instead writes it on to the filesystem...
-we could in the ZODB put a hack to say if pickling something with so
and so attribute do this instead...

I feel like this something I should just not be doing, but it would be great
if I could get it work...

--
  Andy McKay.




___
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] manage_options in 2.3

2001-02-08 Thread Tres Seaver

"Chris Withers" [EMAIL PROTECTED] wrote:


  ActivePython 2.0, build 202 (ActiveState Tool Corp.)
  based on Python 2.0 (#8, Oct 19 2000, 11:30:05) [MSC
  Type "copyright", "credits" or "license" for more in
   a = ('a','b','c','d')
   print type(a)
  type 'tuple'
   b = a[1:]
   print b
  ('b', 'c', 'd')
 
 Hmmm... does 'normal' python work like that too? Probably...

$ python
Python 1.5.2 (#1, Feb  1 2000, 16:32:16)  [GCC egcs-2.91.66 19990314/Linux
(egcs- on linux-i386
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
 a = ( 1,2,3,4 )
 a
(1, 2, 3, 4)
 a[ 1:3 ]
(2, 3)

 Ah well, you learn something new every day :-)

Only on the good days -- the bad ones you spend in meetings. :)

Tres.
-- 
===
Tres Seaver[EMAIL PROTECTED]
Digital Creations "Zope Dealers"   http://www.zope.org

___
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] Greedy except clauses

2001-02-08 Thread richard

I've run into several greedy except: clauses now, and have submitted
patches to make them a little less greedy. Out of curiosity, I searched the
Zope source for "unfiltered" except: clauses...

% grep -rl "except:$" . |wc -l
102

... erk

Just picking some of the results of that search at random, I noticed places
where underlying exceptions could be eaten where I'm sure they'd be better
propogated up...

BTW, I did that little search above when I had a stupid (read: cut'n'paste
:) bit of code that recursed on itself. Python generates a RuntimeError
when that happens. I didn't get the RuntimeError. Zope simply quit on me
with no error message. I have no idea where the RuntimeError is being
caught, but I would strongly argue that it shouldn't be!

I'm willing to have a go at cleaning some of those except: clauses up, but
I can't possibly do 102 of them (I have a product dealine coming up :)


Richard

-- 
Richard Jones
[EMAIL PROTECTED]
Senior Software Developer, Bizar Software (www.bizarsoftware.com.au)

___
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] Greedy except clauses

2001-02-08 Thread Anthony Baxter

 [EMAIL PROTECTED] wrote
 I've run into several greedy except: clauses now, and have submitted
 patches to make them a little less greedy. Out of curiosity, I searched the
 Zope source for "unfiltered" except: clauses...
 % grep -rl "except:$" . |wc -l
 102

 ... erk

Erk and a lot. This is a major major pain in the backside - e.g. the
one in MailHost that just eats template rendering errors.

 I'm willing to have a go at cleaning some of those except: clauses up, but
 I can't possibly do 102 of them (I have a product dealine coming up :)

Is it the sort of thing where it's just work putting a list of all of
them (line numbers, c) up on a web page, maybe crosslinked into cvsweb?
Then people can go and pick them off, one at a time.

Anthony

___
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] Storing part of an object on the file system

2001-02-08 Thread Jimmie Houchin

I would like to throw in something I've been thinking about for the last
week or so.

I would like to use Tux as the front-end of my website.

For info on Tux.
ftp://ftp.redhat.com/pub/redhat/tux/tux-2.0/
http://www.redhat.com/products/software/ecommerce/tux/

From the website:
"""TUX is a kernel-based, threaded, extremely high performance HTTP
server. It is able to efficiently and safely serve both static and
dynamic data. TUX moves the HTTP protocol stack to the kernel, and can
handle requests for data with both kernel-space and user-space
modules."""


It has been reported to do over 10,000 requests per second on a static
html file of 1666 bytes. It did over 1,000 rps doing a cgi program,
opening and closing the cgi app each request. I read this from Linux
Weekly News which got it off of the Linux Kernel Mailing List.

From what I understand Tux 1.0 holds the SpecWeb record. Tux 2.0 is
faster. :)

I think it would be interesting to see Zope fronted by Tux. If there
were a Tux cache manager for Zope that would be awesome.

I've been trying to figure out how to maximize what Tux can serve and
what Zope can manage. An optimal mix between the two could create a very
manageable and fast website. Tux primarily caches what is available on
the file system. It can serve multiple files (objects) sequentially as
instructed by the "user module" as part of a single client request, thus
assembling the request to send to the client. I'm butchering the
explanation, but any ways, it's fast.

Unfortunately, I am still working on understanding Tux and how to best
use it. I don't program C and so reading the sample code hasn't sunk in
yet. I don't know how to integrate it with Zope. It would be great it
one of the brilliant people on this list could figure this out. :) :) :)

Just thinking out loud.

Jimmie Houchin



Andy McKay wrote:
 
 Ok whack idea #34... Well sort of, the idea was sparked by ExtFile (yes its
 all his fault honest). We want to have files on the file system for many
 reasons which I won't go into now, just take it for granted. But we also
 want some of the objects information to be in the standard data.fs, so we
 can catalog it use acquisition provide a simple interface to it and so on.
 So far you are saying thats ExtFile and you are right.
 
 But we want to extend it to any object anywhere, instead of storing the data
 attribute in the object and pickling it in the ZODB I want to be able to
 store the data attribute on the file system. This gives us loads of
 advantages we also thought this would be extremely useful to other people.
 We've bounced around ideas on how to do this and here the only two so far:
 
 -we could overload the data attribute with a class that on Pickling into
 the ZODB instead writes it on to the filesystem...
 -we could in the ZODB put a hack to say if pickling something with so
 and so attribute do this instead...
 
 I feel like this something I should just not be doing, but it would be great
 if I could get it work...
 
 --
   Andy McKay.

___
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] Greedy except clauses

2001-02-08 Thread Anthony Baxter

  Is it the sort of thing where it's just work putting a list of all of
  them (line numbers, c) up on a web page, maybe crosslinked into cvsweb?
  Then people can go and pick them off, one at a time.

ok dokey - so, is DC still running a source view web system? If so, 
you could easily enough run a daily job like:

find . -name '*.py' -print | xargs grep -n 'except:' | cut -d: -f1,2

to get the list of them from the source, and put the root of a viewcvs URL 
on it.  Hm, viewcvs doesn't really cut it for this, but lxr would...

whatcha think?

___
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] Greedy except clauses

2001-02-08 Thread Anthony Baxter

ooo. Richard didn't do it right - there's actually over _600_ bareword
except: clauses in the current zope-2_3-branch

A quick breakdown of some of the biggies:

71 in OFS/
61 in ZODB/
56 in ZServer/
53 in ZGadflyDA
50 or so in what seems to be test scripts or modules (probably ok)
42 in ZPublisher/
42 in DocumentTemplate/
40 in App/
38 in AccessControl/
32 in Shared/DC/ZRDB/
24 in ZCatalog
15 in webdav/
15 in DateTime/
13 in PythonScripts
12 in utilities/ or the install scripts
11 in OFSP/

Now, it's obvious that not all of these are bad - some are probably fine -
but there's also many that are _not_ good. The one in MailHost.py does
eat exceptions. I'm sure there are others.

I've done a quickie hack script that runs over the source and produces 
a list of matches to lines in the file, and links to a lightly patched
viewcvs so that you can jump straight to the lines. It seems like it
would be reasonably easy to make this a bit more sophisticated to include
things like the nesting 'def' and 'class' method. 

This, to me, seems like a pretty nice community type task - people could
take one of them off the list of unchecked ones, and have a look through
the code... no?

Anthony

___
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] Storing part of an object on the file system

2001-02-08 Thread Arno Gross

I had a similar problem. I'm using ExtImage, but I need some extensions for it.
Because I using a RDMBS (currently MySQL) I wanted to have all the meta data
in my RDMBS.  
For all my objects there is normally a 'InsertMethod'. This can be a ZSQL
method (if just MySQL is involved) or it can be a DTML method.
For inserting an Picture object I have two steps in my DMTL InsertMethod:
dtml-let 
ret="manage_addProduct['ExtFile'].manage_addExtImage(title=_['PICTURE.TITLE'], 
   descr=_['PICTURE.DESCR'],
   file=_['PICTURE.FILE'], 
   content_type='', 
   create_prev=create_prev, 
   maxx=maxx,   
   maxy=maxy, 
   ratio=ratio, 
   permission_check=permission_check,   
   REQUEST=REQUEST)" 
dtml-if expr="_.string.find(ret,'success') != -1"
   dtml-call 
"REQUEST.set('PICTURE.PIC_NAME_ID',_.string.strip(getImageName(message=ret)))"
   dtml-call "REQUEST.set('PICTURE.TITLE',_['PICTURE.TITLE'])"
   dtml-call PictureInsertMethod  // this is a ZSQL Method
   dtml-call "RESPONSE.redirect('SearchResult?GALERIE.GALERIE_ID='+ 
_.str(_['GALERIE.GALERIE_ID']))"
  dtml-else
dtml-var ret
  /dtml-if
/dtml-let 

Okay, it's not transaction safe for now, but  that's is acceptable in my
environment. Of course there can be some improvements.
Hint: I extended ExtImage for dynamic resizing. A preview is computed on the
fly. Maybe there is a need for this. I will send the extension to Gregor.

Best regards
  Arno Gross, [EMAIL PROTECTED]

On Thu, 08 Feb 2001, you wrote:
 Ok whack idea #34... Well sort of, the idea was sparked by ExtFile (yes its
 all his fault honest). We want to have files on the file system for many
 reasons which I won't go into now, just take it for granted. But we also
 want some of the objects information to be in the standard data.fs, so we
 can catalog it use acquisition provide a simple interface to it and so on.
 So far you are saying thats ExtFile and you are right.
 
 But we want to extend it to any object anywhere, instead of storing the data
 attribute in the object and pickling it in the ZODB I want to be able to
 store the data attribute on the file system. This gives us loads of
 advantages we also thought this would be extremely useful to other people.
 We've bounced around ideas on how to do this and here the only two so far:
 
 -we could overload the data attribute with a class that on Pickling into
 the ZODB instead writes it on to the filesystem...
 -we could in the ZODB put a hack to say if pickling something with so
 and so attribute do this instead...
 
 I feel like this something I should just not be doing, but it would be great
 if I could get it work...
 
 --
   Andy McKay.
 
 
 
 
 ___
 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 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] Greedy except clauses

2001-02-08 Thread Anthony Baxter

Ok, my last for tonight - I put the output of my horrible script at

http://www.zope.org/Members/anthony/BarewordExcepts

I'll work over it a bit probably early next week - an obviousish next
step is to make it note when the body of the except: contains a 'raise'
statement. 

Anthony

___
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] Stop words/vocabulary

2001-02-08 Thread Arno Gross

Hello Dieter,
I have now a german stop word list and would like to
apply it for my current ZCatalog 'NewsCatalog'. But how? 
Or should I copy my list to the source (no good idea)?
Thanks.

On Thu, 08 Feb 2001, Dieter Maurer wrote:
 Arno Gross writes:
   Can I apply stop words in a ZCatalog?
 You can:
 
   ZCatalog's "Lexicon"'s (-- SearchSupport.Lexicon.Lexicon)
   have a method "set_stop_syn" to provide a mapping
   for synonyms and stop word.
 
   I think, the source documentation is wrong:
 
 It says, the mapping would map words to a list of synonyms.
 When I looked at the code in "SearchSupport/Splitter.c",
 I had the impression that a map from a word
 to a single replacement is expected.
 A "None" replacement signifies a stop word,
 other replacements can be used for stemming
 or synomyms.
 
   Are there stop words for german available?
   If not I would try to compose a stop word list for german
   and publish it.
 Good!
 
 
 
 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 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 )