Trying to contact Lee Harr <missive at>

Khalid Sheikh khalid.sheikh at
Wed Jul 23 23:07:49 CEST 2003

Hi Lee,

Not sure why my email got bounced. If you read this please reply back so I
can send you the appropriate documentation so I can get your help in finding
out what's in the spider.Collection[i] name space.


-----Original Message-----
[mailto:MAILER-DAEMON at]
Sent: Wednesday, July 23, 2003 1:57 PM
To: khalid.sheikh at
Subject: failure notice

Hi. This is the qmail-send program at
I'm afraid I wasn't able to deliver your message to the following addresses.
This is a permanent error; I've given up. Sorry it didn't work out.

<missive at>:
maildrop: This user's mailbox is full.

--- Below this line is a copy of the message.

Return-Path: <khalid.sheikh at>
Received: (qmail 26526 invoked from network); 23 Jul 2003 20:56:48 -0000
Received: from unknown (HELO ([])
          (envelope-sender <khalid.sheikh at>)
          by (FrontierMTA 2.3.6) with SMTP
          for <missive at>; 23 Jul 2003 20:56:48 -0000
Received: from (sbay.Silvaco.COM [])
	by (8.11.6+Sun/8.11.6) with ESMTP id h6NKulR11333
	for <missive at>; Wed, 23 Jul 2003 13:56:47 -0700 (PDT)
Received: from hades (hades [])
	by (8.9.3+Sun/8.9.3) with SMTP id NAA05397
	for <missive at>; Wed, 23 Jul 2003 13:56:46 -0700 (PDT)
From: "Khalid Sheikh" <khalid.sheikh at>
To: <missive at>
Subject: Re: Newbie question about strings
Date: Wed, 23 Jul 2003 13:56:46 -0700
MIME-Version: 1.0
Content-Type: multipart/mixed;
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0)
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000

This is a multi-part message in MIME format.

Content-Type: text/plain;
Content-Transfer-Encoding: 7bit

Hi Lee,

Thank you for all your help. Sorry for the late response to your answer. I
am not used to the python list and wasn't aware of such volume of posts that
are generated on this emailing. List. To answer one of your question, no I
am not familiar with Python, like I mentioned in my email I have been tasked
to integrate verity enterprise search with our J2EE compliant app server. I
am trying to pick up python but I still haven't caught up yet. I haven't
been able to find a good reference book that deals with html embedded
python. most books talk about generating html through python. Can you
recommend a good book for that purpose. The book I picked up is titled Core
Python Programming by Wesley Chow.

I am not sure if any API calls are being made. I am including the html doc
for your reference

In article <mailman.1058831613.12207.python-list at> wrote:
> Hi,
> I have been tasked to Integrate Inktomi Search (now Verity of course)
> with our website. I am fairly new to Python. The way the search
> engine is setup is that it has embedded python in a html document.
> After looking at the html code for a day or so, I was able to pin
> point the place where I need to make a change but I am having a hard
> time.
> I am assuming
> &$self.text(dbcol[docdb].pretty_name);
> prints something in HTML but I am trying to figure out it's
> equivalent
> in Python. I am assuming this is a string and I need to check it's
> value against another string say 'XXY' if it is equal then go ahead
> and print that value otherwise skip to the next item in the
> list/array.
> This is what I had before and it worked
> first = 1
> for docdb in docdbs:
> if not dbcol.has_key(docdb): continue
> if first: first = 0; --> <!--$
> else: -->, <!--$
> -->Test< &$self.text(dbcol[docdb].pretty_name); >Test<!--$
> if not first: -->
> when run this prints
> Test< XXY >Test, Test< ABCD >Test
> I want it to print only when the string is equal to XXY. otherwise
> skip to the next string. This is the edited code that I have so far.
> first = 1
> for docdb in docdbs:
> if not dbcol.has_key(docdb): continue
> if first: first = 0; --> <!--$
> else: -->, <!--$
> # my code
> if dbcol[docdb] == <spider.Collection 'pc'> --> <!--$
> # end of my code

if dbcol[docdb] == spider.Collection('pc'): do_something();

I am not sure if spider is going to be found though,
I would need to see the API documentation to know
what is available in the namespace.  It looks, though
as if your code would need to be valid python.

> -->Test< &$self.text(dbcol[docdb].pretty_name); >Test<!--$
> if not first: -->
> I get the following error when I run the program.
> exceptions.SyntaxError: invalid syntax (line 86)
> Line 86
> if dbcol[docdb] == <spider.Collection 'pc'> wlines.append(u' ');
> Any help would be greatly appreciated.

Do you know python?  It might be a good start to go through
the python tutorial...


Content-Type: text/html;
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;

<!--$#-*- mode: python; indent-tabs-mode: nil; encoding: iso-8859-1 -*-=0A=
# Copyright 2000-2002 Inktomi Corporation.  All rights reserved.=0A=
if not title: title =3D brkurl(url,60,la)=0A=
width1 =3D 40*score/100=0A=
width2 =3D 40-width1=0A=
fshref =3D =
if first_hit: =0A=
    passages =3D 0=0A=
    first_hit =3D 0=0A=
    dbcol =3D {}=0A=
    if len(cols)>1 and len(qcols)>1:=0A=
        for c in cols:=0A=
            if not c in qcols: continue=0A=
            if c.passage_summaries: passages =3D 1=0A=
            qdbs,idbs =3D c.dbs=0A=
            for db in qdbs: dbcol[db.dbid] =3D c=0A=
            for db in idbs: dbcol[db.dbid] =3D c=0A=
    elif len(cols)=3D=3D1:=0A=
        passages =3D cols[0].passage_summaries=0A=
    passages =3D passages and enable_passages=0A=
elif (print_line) and (ct is None or qti): =0A=
    --><hr size=3D1 width=3D"&$pw;" align=3Dleft><!--$=0A=
else: =0A=
title =3D htmlquote(title)=0A=
description =3D =
description =3D htmlquote(description)=0A=
if config.language_term_highlighting(la) and oqqtex and not fs: =0A=
    title =3D collectn.highlight(=0A=
        u'<font size=3D"+1" class=3Dhighlight>',u'</font>')=0A=
    description =3D collectn.highlight(=0A=
        u'<b class=3Dhighlight>',u'</b>')=0A=
pass_sep =3D u' <b>...</b> '=0A=
description =3D =
<table cellspacing=3D0 cellpadding=3D1 width=3D"&$pw;">=0A=
<tr valign=3Dtop>=0A=
<td width=3D"95%">=0A=
if ct is not None and not qti:=0A=
    topic_dict =3D topic.current.urls.get(string.lower(url))=0A=
    if topic_dict is not None:=0A=
        if topic_dict.has_key(ct):=0A=
            stars =3D topic_dict[ct]=0A=
            for i in range(0,stars):=0A=
                --><img alt=3D"star" width=3D10 height=3D10 =
if url[:5] =3D=3D 'file:': linkurl =3D urllib.unquote(url)=0A=
else: linkurl =3D url=0A=
<b class=3Dtitle><a href=3D"&$linkurl;"> Title =
<span class=3Ddescription> Description =
if config.inline_topics_fullpath:=0A=
    for id in topics:=0A=
        --><font size=3D"-1" =
class=3Dinlinetopic><b>&$self.text(u'Topic');:  </b><a =
<!--$        =0A=


# Khalid's Code

first =3D 1
for docdb in docdbs:
    if not dbcol.has_key(docdb): continue
    if first: first =3D 0; --> <!--$
    else: -->, <!--$
	# Need to add logic here=20
	# looking for a key word here.
	# the array has two items 'pc' and 'silvaco'
	# Need to check against 'pc' so that
	# if array[i] =3D=3D 'pc'
	# then print something
	# else do nothing.
	if dbcol[docdb] =3D=3D 'pc':
		-->Test< &$self.text(dbcol[docdb].pretty_name); >Test<!--$
	else: --> <!--$
    if not first: -->

	# End of Khalid's changes
<font size=3D"-1" class=3Dpublisher><i>&$publisher;</i></font>=0A=
<font size=3D"-1" class=3Durl><i>&$brkurl(url,70); -</i></font>=0A=
<font size=3D"-1" class=3Dsize><i>&$"%.1f"%(size/1024.0);KB</i></font>=0A=

if ws:=0A=
    first =3D 1=0A=
    for term,scor in dterms:=0A=
        if first: first =3D 0; --><font size=3D"-1" =
class=3Dwordscores><i> <!--$=0A=
        else: -->, <!--$=0A=
        -->&$term;: &$max(int(scor+0.5),1);<!--$=0A=
    if not first: --></i></font>=0A=
if extra:=0A=
    --><table cellspacing=3D1 cellpadding=3D0 border=3D0>=0A=
    extralist =3D extra.items()=0A=
    for key,val in extralist:=0A=
        --><tr valign=3Dbaseline>=0A=
        --><td width=3D"10%"><font size=3D"-1" =
        --><td width=3D"90%"><font size=3D"-1" =
<td width=3D"5%">=0A=
<table cellspacing=3D0 cellpadding=3D0 width=3D80>=0A=
if ct is None or qti:=0A=
    --><tr><td><span class=3Dscore><!--$=0A=
    -->&$score;%</td></tr><tr><td><span class=3Dbar><!--$=0A=
    if width2>0:=0A=
        --><font size=3D-2 color=3D"#0000D0" class=3Dleftbar><!--$=0A=
        for wide in range(width1/2):=0A=
    if width1>0:=0A=
        --><font size=3D-2 color=3D"#C0C0C0" class=3Drightbar><!--$=0A=
        for wide in range(width2/2):=0A=
if modtime:=0A=
    --><tr><td><span class=3Ddate><!--$=0A=
    try: localtime =3D time.localtime(modtime)=0A=
    except: pass=0A=
    else: write(string.replace(htmlquote(time.strftime(self.text(u'%d %b =
%y'),localtime)),u' ',u'&nbsp;'))=0A=
if iterms:=0A=
    --><tr><td><font size=3D"-1" class=3Dfs><!--$=0A=
    --><a href=3D"&$fshref;">&$self.text(u'Find Similar');</a><!--$=0A=
for matcher,val in config.compiled_result_icon_alist:=0A=
    if not matcher(url): continue=0A=
    isrc,iwidth,iheight,ihref =3D val=0A=
    if ihref: --><a href=3D"&$ihref;"><!--$=0A=
    --><img alt=3D"" src=3D"&$isrc;" width=3D&$iwidth; =
height=3D&$iheight; border=3D0 align=3Dleft><!--$=0A=
    if ihref: --></a><!--$=0A=


More information about the Python-list mailing list