[Zope-dev] Efficient serving of large files using iterator?

2013-02-20 Thread lists
Hi,

I've tried

from ZPublisher.Iterators import filestream_iterator
return filestream_iterator('/home/chrism/bigfile.xls', 'r')

in a method to return a big file to users;  however, it doesn't work, are
there alternative ways to serve large files to users, serving files that
are lying somewhere on the filesystem?

Thanks,

Morten

-- 
Nidelven IT || We know Python, Zope & Plone

http://www.nidelven-it.no/

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


Re: [Zope-dev] AccessControl bug fixed

2012-08-23 Thread lists
Hi,

does this have any security implications?

> On Wed, Aug 22, 2012 at 3:00 PM, Yusei TAHARA  wrote:
>> I found a bug in ZopeSecurityPolicy and fixed it.
>>
>> http://svn.zope.org/AccessControl/trunk/src/AccessControl/ZopeSecurityPolicy.py?rev=127548&r1=113657&r2=127548
>>
>> Is it possible to release new version?
>
> I can do that. But is there any chance you could write a test for
> this. Or at least tell us how you found this bug?
>
> Hanno
> ___
> Zope-Dev maillist  -  Zope-Dev@zope.org
> https://mail.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  **
> (Related lists -
>  https://mail.zope.org/mailman/listinfo/zope-announce
>  https://mail.zope.org/mailman/listinfo/zope )
>


-- 
Nidelven IT || We know Python, Zope & Plone

http://www.nidelven-it.no/

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


[Zope-dev] Getting REQUEST from within RESPONSE?

2012-01-30 Thread lists
Hi.

I have a patch for Zope that sets expiry dates far into the future for
certain cookies.  However, I would like to know something about where the
user is, or what the user is doing.

Is there a way to get the REQUEST from within a RESPONSE method?

TIA,

Morten

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


Re: [Zope-dev] Undo product stops working with recent Zope (StorageTransactionError)

2012-01-24 Thread lists
On Tue, 24 Jan 2012 14:50:44 +0100, Hanno Schlichting
 wrote:
> On Tue, Jan 24, 2012 at 2:14 PM,   wrote:
>> It used to work, but with the most recent versions of
>> Zope this error appears if the Undo by date is used
>> more than once:
> 
> The undo API has changed with ZODB 3.10. As noted in the changelog:
> 
> "The API for undoing multiple transactions has changed. To undo
> multiple transactions in a single transaction, pass a list of
> transaction identifiers to a database's undoMultiple method. Calling a
> database's undo method multiple times in the same transaction now
> raises an exception."
> 
> Your code calls undo multiple times, and needs to be changed accordingly.

Aha.  OK, thanks! :)

Regards,

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


[Zope-dev] Undo product stops working with recent Zope (StorageTransactionError)

2012-01-24 Thread lists
Hi,

I have a product that patches Zope so that the Undo
screen also accepts a date and time for when to roll
back to (on pypi as Products.Undoer).

It used to work, but with the most recent versions of
Zope this error appears if the Undo by date is used
more than once:

2012-01-24 13:45:32 ERROR Zope.SiteErrorLog 1327409132.230.397033237621
http://localhost:8080/Plone/undo_changes_by_date
Traceback (innermost last):
  Module ZPublisher.Publish, line 134, in publish
  Module Zope2.App.startup, line 301, in commit
  Module transaction._manager, line 89, in commit
  Module transaction._transaction, line 329, in commit
  Module transaction._transaction, line 441, in _commitResources
  Module ZODB.DB, line 990, in tpc_begin
  Module ZEO.ClientStorage, line 1116, in tpc_begin
StorageTransactionError: Duplicate tpc_begin calls for same transaction

The code looks like this:

def undo_changes_by_date(self, date=None, REQUEST=None):
"""Undoes changes made to the database after a given date;  if
a date is not specified, all changes are undone."""
if date is None:
date = float(0)
elif type(date) == types.StringType:
date = float(DateTime(date))
else:
date = float(date)
transactions = self._p_jar.db().undoLog(0, 2**32)
undo=self._p_jar.db().undo
count = 0
for transaction in transactions:
if transaction['time'] >= date:
undo(transaction['id'])
count += 1
if REQUEST:
return MessageDialog(
title='Result of undoing transactions',
message="%s transactions were undone" % count,
action='./manage_UndoForm'
)
return count

Any ideas?  Do I need to do a tpc_begin myself?

-Morten

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


Re: [Zope-dev] Enabling External Methods in skin folders

2011-11-22 Thread lists
> On 17 November 2011 11:28,   wrote:
>> Hi,
>>
>> I have a bunch of External Methods I'd like to make available in a skin
>> form, and which reload in the same way a page template would if it was
>> modified and the server was in debug mode.
>
> External methods should not require restarts either.
>
>> What's the recommended product for enabling this now?
>
> A more robust approach may be to turn your external methods into
> views, utility functions called from other views, portal_setup upgrade
> steps, or whatever other purpose they serve.

Yeah, OK.  Well I have a bunch of old code which we're trying to reuse, in
the simplest way possible.

I figured out that since those External Methods were all living in one
folder to start with, simply importing that folder into the Plone root
will do, for now.  :)

-Morten

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


[Zope-dev] Enabling External Methods in skin folders

2011-11-17 Thread lists
Hi,

I have a bunch of External Methods I'd like to make available in a skin
form, and which reload in the same way a page template would if it was
modified and the server was in debug mode.

What's the recommended product for enabling this now?

-Morten

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


[Zope-dev] Raw search through entire Zope database?

2011-10-12 Thread lists
Hi,

I have a problem with some values for images changing, and
I can't figure out why (access something.jpg changes to
somethingelse.jpg).

I can see with a grep on the Data.fs file that the changed-to
value is there but I can't see in which context.

Is there some script that will enable a "raw" search through
everything that is in the database and give a usable result?

-Morten

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


Re: [Zope-dev] Getting translation of python code string to work

2011-06-01 Thread lists
> Hi Morten,

Hi Leonard,

> On Tue, May 31, 2011 at 13:19,   wrote:
>> Hi,
>>
>> I have a oldschool style Zope 2 product, which has an i18n
>> directory containing translations.
>>
>> Using i18n:domain="SimpleChat" in this product works fine in
>> the page templates,
>
> Well, ZPTs generate message objects automatically from translated
> content, but they also explicitly translate all the message objects
> they get during interpolation between the literal parts of the
> template and the dynamically generated ones.
>
>> but when I start translating text in
>> a Python module using _("Translate me") I just get English
>> text (instead of Norwegian, which is what I want).
>
> When you say "I just get English text", what does exactly "get" mean
> in terms of code?
>
> Mind you, if you simple call unicode(message) you'll most likely only
> get the English version back. Same thing if you do:
>
>   u"some other string: %s" % message
>
> To get an actual translation, you need to call
> zope.i18n.translate(message), eventually passing the
> "target_languate=..." parameter.
>
> Take a look at the zope.i18n module for details, specifically the
> translate() and negotiate() functions.

OK.  Well I have this function now:

def _(msgid, request):
language = request['LANGUAGE']
return translate(msgid, domain='SimpleChat', target_language=language)

Which sends all the relevant bits to the translate function.  But, this
doesn't work either, and I can see it is because the interpolate function
call is used in translate.

So do I need to setup some utility?

-Morten

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


[Zope-dev] Getting translation of python code string to work

2011-05-31 Thread lists
Hi,

I have a oldschool style Zope 2 product, which has an i18n
directory containing translations.

Using i18n:domain="SimpleChat" in this product works fine in
the page templates, but when I start translating text in
a Python module using _("Translate me") I just get English
text (instead of Norwegian, which is what I want).

The top of the module contains this:

from zope.i18nmessageid import MessageFactory
_ = MessageFactory('SimpleChat')

Any ideas?

TIA,

Morten

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


[Zope-dev] Good storage/system for sessions

2011-01-05 Thread lists
Hi.

We've experienced some problems with the Transcience/SESSION system, where
KeyErrors can pop up for unknown reasons.

Therefore, I was thinking of writing/using a custom session system, which
doesn't do anything "magical", just stores it into some kind of database.

It would have to support multiple ZEO clients, and I'm thinking it should
also "respect" the transaction machinery, so that if something fails, the
changes are rolled back.

I've thought of different approaches, but right now, the best approach seems
to be a separate database file, in FileStorage, BSDDB or some such variant,
mounted at the point /session for example.

Then have 3 methods/functions which set, get and delete entries in the
storage as necessary.  Every user gets a unique cookie and corresponding
place in the database.

What's the recommended way to handle up to many, many small objects with
frequent writes?

Am I making unecessary work for me here, or could such a system be useful?

Has something like it been made before?  Is it better to test and fix
the Transcience/SESSION system?

-Morten

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


Re: [Zope-dev] freebsd file: table is full when starting zope2

2001-02-14 Thread Zope mailing lists

On Wed, 14 Feb 2001, Sin Hang Kin wrote:
> When starting Zope2.3 from the freebsd box, the kernel says : file: table is
> full.
> 
> The kern.maxfiles is set to 1064, does zope really need that many? what
> number should I need to make zope happy?

I noticed this problem with Zope and FreeBSD a long time ago, and
managed to track it down to zserver or python or a python module
opening every possible socket number separately on startup (this
is from an lsof dump as zserver is starting).  The ones it doesn't
use get closed somehow, but it sure was a weird thing to see.  I've
no idea if this is a bug in zserver/python or a bug in FreeBSD,
and since it hasn't been causing me any real problems (just the
message in the log), I haven't bothered to track it further.  I
still see the messages though, and I'm now running FreeBSD 4.2S
and Zope 2.3.0.

--RDM


___
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] 2.3.0 bug in fmt=?

2001-02-02 Thread Zope mailing lists

 produces a blank, no matter
what the value of somevar.  I could swear this works in other versions
of zope, but it seems like an awfully fundamental bug to have slipped
through the 2.3.0 release process.  Can anyone tell me what stupid
thing I'm doing wrong?

--RDM


___
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] 2.3.0 bug in fmt=?

2001-02-02 Thread Zope mailing lists

Nevermind. As usual, as soon as you post you figure it out.  The value
of the var was a string and not a float...

Sorry for wasting bandwidth.

Although, come to think of it, should it throw an error rather than
silently eating the value?

--RDM


___
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 2.3.0 upgrade bug: inituser trashes existing user

2001-01-29 Thread Zope mailing lists

I have not thoroughly tested this, but I have done it twice to make
sure I could reproduce the error I saw in the specific circumstances
I saw it.  I suspect the bug is generic, but don't have the time to
prove it right now.  My setup:

INSTANCE_HOME style setup.
Zpatterns installed in 2.3.0 tree
EMarket installed in the instance products folder.
RedHat Linux 5.2 (I think, how do you tell on a linux system?)
python from RPMs, zope 2.3.0 from source install (wo_pcgi).

I upgraded an existing site by simply changing my zopectl (see my product)
PYTHONHOME setting to the 2.3.0 tree, shutting down the site (which
had been running 2.2.4), and restarting.  Now, at this point I did
not understand how inituser was supposed to work, so I had copied
my old access file to be my inituser file, thinking the name had
changed but the semantics were similar.  Imagine my surprise when
the inituser file dissapeared when I started zope .

The problem is that the inituser *replaced* the single existing
user in the acl_users folder.  This must be a bug.

--RDM

PS: I also was amazed to find that having ZDebug (without Chris'
patch) in my Products folder left my site *wide* open: anonymous
could view and edit methods.  This might be worth a warning
on the web site, even though it is unlikely anyone would run
production with ZDebug installed.


___
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] Massive scalability

2001-01-16 Thread Zope mailing lists

On Tue, 16 Jan 2001, Michael Bernstein wrote:
> I do not know if BTree folders and Racks share the same
> B-Tree implementation, which is why I qualified my statement
> as 'slightly less confident'.

I'm fairly certain that BTree folders, Squishdot, and Racks all
use the BTree module that comes with zope, each in their own way.
(Note that that module has some issues with DB activity on writes,
which I believe someone is eventually going to fix...)

> Hmm. John Eikenberry mentioned a slowdown with about 50,000
> objects on partial-match searches, but I don't know how

I have not experiemented with partial match searches, although
I did build the site with that type of index.

> simple/complex the objects were, or how many atributes were
> being indexed. How many indexes of various types was your
> ZCatalog maintaining on your objects?

The catalog indexed just a few pretty short text properties,
and searching is really done only one one (the longest) field.

--RDM


___
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] Massive scalability

2001-01-16 Thread Zope mailing lists

On Mon, 15 Jan 2001, Michael Bernstein wrote:
> as Squishdot). Adding a dependency on an RDBMS or requiring
> additional setup on the server's FS seems a step in the
> wrong direction.
[...]
> So the question remains: Will either approach (within the
> ZODB) allow me to scale the application to hundreds of
> thousands (or even millions) of objects indexed in a
> ZCatalog?
[...]
> I know that the ZCatalog/ObjectManager approach used by
> Squishdot will scale to over 9,000 objects (the number of
> postings to date at technocrat.net), So I'm reasonably
> certain that my proposed ZCatalog/BTree Folder approach will
> be at least as scalable. I'm slightly less confident about
> the Specialist/Rack approach, because I don't know of any
> sites that have used them to store that many objects in the
> ZODB, but only slightly.

My understanding is that the point of ZPatterns is to hide
the data storage implementation from the application.  You refer
to this in another post.  The point being that you can *change your
mind* later, with minimal disruption to your application.  Not
only that, but people who *use* your product can make their
own decision about where to store the data.  So by using ZPatterns
you would have a product that could be installed without
any addons other than ZPatterns itself, and yet let the users
of your product use an RDBMs if that works better for them.

In addition, it seems to me that your comments about ZCatalog+BTree
apply equally well to ZPatterns, since you can use the Catalog
to index stuff stored in a rack through the use of appropriate
triggers, and it is my understanding that the default in-ZODB
rack storage uses BTree internally.

So overall I'd think going with ZPatterns would be the right
decision.  It gives you and others using your code the
maximum flexability.

Unfortunately I don't have much input on your question about
real-life scalability...the most I've done is stored 6 small objects
in a hierarchy of zope folders, indexed by the catalog, with
no perceptable slowdown in search or retrieval speed.

--RDM


___
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] ZPatterns implementation question: images attributes?

2001-01-13 Thread Zope mailing lists

On Sat, 13 Jan 2001, Steve Alexander wrote:
> Here's the simplest approach that I can think of.

Thanks, Steve, that's great.  I can even simplify it since there's
a one to one correspondence between products and images, so I can
just use the product Id as the Image Id.  If that correspondence ever
breaks, it'll be a sign that its time to promote the images to
their own specialist...

I think I'm slowly getting the hang of this.  Now, if I can just manage
to finish reading Coad...

--RDM


___
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] ZPatterns implementation question: images attributes?

2001-01-13 Thread Zope mailing lists

I have a specialist (actually, EMarket has a specialist ) that
manages objects that from a design point of view I think should have
a couple of Images as attributes (thumbnail and fullsized images of
the product).  The question is, how do I implement this using
ZPatterns?  Currently all of the other object data is pulled from an SQL
database.  I don't mind storing the Images in the ZODB, but I'm having
a hard time finguring out how I would implement that.  Pointers or
alternate design suggestions welcome.

--RDM


___
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] New UI for 2.3

2001-01-12 Thread Zope mailing lists

On Thu, 11 Jan 2001, Brian Lloyd wrote:
> Are you guys working on 486's with 13in. monitors at 640x480 or 
> something? :^)

Let's put it this way: I have my window frame borders on my xwindows
set to 1 pixel because I feel that the default (6?) pixel width
wastes way too much screen realestate (I use tiled windows a lot).
This is on a 17" 1024x768 monitor, and I'd probably do the same on
a 20".

> area sizes. That could also have a "hide top frame" option for 
> those who really can't spare the 32px. :^)



>From my (peculiar, I'll admit) point of view, there isn't much
difference between the old and new interface.  I like the add
dropdown being at the top, I'm indifferent to the additional item
information, though the sorting looks like it might be useful, and
those are about the only differences I notice.  See, I use w3m and
I always go to 'manage_main', so I never see the other frames or
any of the "pretty" graphics

Now, if the management interface were *customizable*, all these
(mild) complaints would go away .  What ever happened to the
'skinnable' project?

All that said, I applaud the "management quick fixes".  Thanks, guys.

--RDM


___
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] python script

2001-01-10 Thread Zope mailing lists

On Tue, 9 Jan 2001 [EMAIL PROTECTED] wrote:
> Damnnation, Chris, everyone knows that it is supposed to be spelled
> Python Thingy.
> 
> "I recently released 'zopectl', a Python Thingy"...
> 
> 'Please go wash your hands before your shake hands with me!'

Hmm.  All kidding aside, Chris is right.  This *is* the problem
with "python script" that was pointed out during the name discussion.
My use of "python script" is the traditional Unix/OS one: "a [shell]
script written in python".

Oh, well...fortunately the users most likely to be confused are the
ones least likely to be using scripts at the os level.

--RDM


___
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] zopectl 0.0.1

2001-01-08 Thread Zope mailing lists

I recently released 'zopectl', a python script that acts as a configurable
front end to the z2.py script, implementing the defacto standard unix process
control commands: zopectl start, zopectl stop, zopectl restart.  I wrote
it to simplify management of a server that runs several zope instances,
so it can also be used to start/stop/restart a collection of zope sites
or any subset of that collection ('zopectl start mysite').  Configuration
is based on a master file, with the ability to override any parameter
for specific sites.

  http://www.zope.org/Members/rdmurray/zopectl

While I orginally wrote it for the production machine, I'm finding
it even more useful on my development machine where I have any
number of Data.fs files for various projects.  I now use an
INSTANCE_HOME setup where I have a directory stucture like this:

/usr/local/zope
  Zope222
  Zope224
  Zope230a1
  sites
devsite1
devsite2
devsite3

In /usr/local/zope I have a zopectl.conf file that specifies my "standard"
setup for my development sites.  In the individual devsite directories
I have zopectl.conf files that override these global settings as
necessary.  Zopectl lets me set different versions of zope to run,
and even different versions of python.  Setting up an override configuration
file has proven to be *much* easier than editing individual site
start and stop scripts.  And by putting zopectl in my path, I no longer
have to cd into the site directory in order to do a start and stop.

Anyway, I'm hoping others will find it useful, too.  The version number
(and the comments in the readme about bugs) are due to the fact that
it hasn't seen much testing yet.  It's been solid for me so far, and
I've now exercised quite a few more parameters than my README comments
would make it appear.

--RDM


___
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 with UTF-8 Chinese

2000-09-28 Thread Zope mailing lists

On Thu, 28 Sep 2000, Sin Hang Kin wrote:
> After reading some code of query, I think the regular expression operations
> which in parse, quotes and parse2 were not safe for utf8 string. So, I

That wouldn't surprise me.

> decide to emulate what they do. However, I do not understand what getlexicon
> is doing and I would like to learn what  q should looks like before it is
> passed to evaluate. I do not understand that vocabulary seems to store like
> integer, is getlexicon a step to look up the string to convert them to
> integer? I am getting lost.

I don't fully understand Lexicon myself, but I've at least spent some
time groveling around in the code.  I understand there's been a relatively
recent checkin of a new version of the text index stuff that at least
provides clearer variable names and additional comments; if you aren't
working from cvs version you might want to browse the files on the
cvs web interface.

So, here's what I understand:

The lexicon takes words and associates them with integers.  It is the
integers that are stored in the text index.  So in the final stages
of the search process, the parsed words are looked up in the lexicon
to get the integer, and the integer is then passed to the index
to get back the result set (list of documents containing the word).
The result set is itself a list of integers.  I think it is in fact
pairs (or some more complex data structure); at the least the index
stores the document number and the word offset (I think it's a word
offset) of the word into the document.

As for what q looks like...well, I haven't grovelled through the
parse, quote, parens, and parse2 code much, so I'm guess a bit here:
I *think* that before it goes into evaluate q is a list of sequences
or words, where the sequences are a list of sequences or
wordsrecursive.  The sub-sequences would be the parenthesized
expressions from the original string.  In the original string, any
occurences of the pair of words 'and not' were replaced by 'andnot'.
Any quoted strings (double quotes only, I believe) were replaced
by sequences of words separated by the 'near' operator ('...').
parse2 makes sure that every other item in q is an operator, by
sticking the default operator, 'or', in between any pairs that
aren't separated by an operator.

If I'm right, an expression like:

This is and not a (good "test of") searching

should end up feeding to evaluate a 'q' like this:

('this', 'or', 'is', 'andnot', 'a', 'or', ('good', 'or', ('test', '...'
   'of')), 'or', 'searching')

I'm least sure of those parens around test...of.

Maybe this will at least give you a clue to enable you to figure
out what the code *really* does .

--RDM


___
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 : UTF-8 Chinese

2000-09-25 Thread Zope mailing lists

On Mon, 25 Sep 2000, Sin Hang Kin wrote:
> I generate the search interface, and test it. However, the search of the
> index terms return nothings. I search most entries found in the vocubalury
> but none works, those work will return many unwanted results also.
> 
> What is causing this failure? What I can do to go further?

It is possible you are having an issue with the way the splitter
is used on the search term input side.  Several of us have found
bugs in that area.  We've fixed the ones we've found, but there
may be more .

Run zope in debug mode ("the debugger is your friend" howto), and
watch what UnTextIndex does with the search terms.  (Hint: instead
of trying to set breakpoints per the howto, just uncomment the
appropriate calls to the debugger in the UnTextIndex or Lexicon
source file...)

--RDM


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