Trying to contact Lee Harr <missive at frontiernet.net>

Khalid Sheikh khalid.sheikh at silvaco.com
Wed Jul 23 17:07:49 EDT 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.

Thanks.

-----Original Message-----
From: MAILER-DAEMON at mx02.roc.ny.frontiernet.net
[mailto:MAILER-DAEMON at mx02.roc.ny.frontiernet.net]
Sent: Wednesday, July 23, 2003 1:57 PM
To: khalid.sheikh at silvaco.com
Subject: failure notice


Hi. This is the qmail-send program at mx02.roc.ny.frontiernet.net.
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 frontiernet.net>:
maildrop: This user's mailbox is full.

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

Return-Path: <khalid.sheikh at silvaco.com>
Received: (qmail 26526 invoked from network); 23 Jul 2003 20:56:48 -0000
Received: from unknown (HELO portal.silvaco.com) ([192.73.228.4])
          (envelope-sender <khalid.sheikh at silvaco.com>)
          by mx02.roc.ny.frontiernet.net (FrontierMTA 2.3.6) with SMTP
          for <missive at frontiernet.net>; 23 Jul 2003 20:56:48 -0000
Received: from sbay.silvaco.com (sbay.Silvaco.COM [10.1.5.1])
	by portal.silvaco.com (8.11.6+Sun/8.11.6) with ESMTP id h6NKulR11333
	for <missive at frontiernet.net>; Wed, 23 Jul 2003 13:56:47 -0700 (PDT)
Received: from hades (hades [10.1.11.15])
	by sbay.silvaco.com (8.9.3+Sun/8.9.3) with SMTP id NAA05397
	for <missive at frontiernet.net>; Wed, 23 Jul 2003 13:56:46 -0700 (PDT)
From: "Khalid Sheikh" <khalid.sheikh at silvaco.com>
To: <missive at frontiernet.net>
Subject: Re: Newbie question about strings
Date: Wed, 23 Jul 2003 13:56:46 -0700
Message-ID: <PDECKCFLILIOFDMCOOMNAEMGCCAA.khalid.sheikh at silvaco.com>
MIME-Version: 1.0
Content-Type: multipart/mixed;
	boundary="----=_NextPart_000_000D_01C35122.4188D410"
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.

------=_NextPart_000_000D_01C35122.4188D410
Content-Type: text/plain;
	charset="iso-8859-1"
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 python.org> 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...

http://python.org/doc/current/tut/tut.html

--
http://mail.python.org/mailman/listinfo/python-list

------=_NextPart_000_000D_01C35122.4188D410
Content-Type: text/html;
	name="onehit1.html"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="onehit1.html"

<!--$#-*- mode: python; indent-tabs-mode: nil; encoding: iso-8859-1 -*-=0A=
# Copyright 2000-2002 Inktomi Corporation.  All rights reserved.=0A=
=0A=
if not title: title =3D brkurl(url,60,la)=0A=
=0A=
width1 =3D 40*score/100=0A=
width2 =3D 40-width1=0A=
fshref =3D =
fsprfx+'&ws=3D0'+'&fs=3D'+urlquote(url)+'&qt=3D&ql=3D'+ql+'&st=3D1&nh=3D'=
+str(nh)+'&lk=3D'+lk=0A=
=0A=
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=
    --><p>=0A=
<!--$=0A=
title =3D htmlquote(title)=0A=
=0A=
description =3D =
passage.smart_abstract(description,title,terms,la,ndocs,passages)=0A=
description =3D htmlquote(description)=0A=
if config.language_term_highlighting(la) and oqqtex and not fs: =0A=
    title =3D collectn.highlight(=0A=
        None,title,terms,la,u'title:',=0A=
        u'<font size=3D"+1" class=3Dhighlight>',u'</font>')=0A=
    description =3D collectn.highlight(=0A=
        None,description,terms,la,u'description:',=0A=
        u'<b class=3Dhighlight>',u'</b>')=0A=
=0A=
pass_sep =3D u' <b>...</b> '=0A=
description =3D =
string.join(string.split(description,passage.separator),pass_sep)=0A=
-->=0A=
=0A=
<table cellspacing=3D0 cellpadding=3D1 width=3D"&$pw;">=0A=
<tr valign=3Dtop>=0A=
<td width=3D"95%">=0A=
<!--$=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 =
src=3D"/images/star.gif"><!--$=0A=
if url[:5] =3D=3D 'file:': linkurl =3D urllib.unquote(url)=0A=
else: linkurl =3D url=0A=
-->
=0A=
<b class=3Dtitle><a href=3D"&$linkurl;"> Title =
<!--$write(title);--></a></b><br>=0A=
<span class=3Ddescription> Description =
<!--$write(description);--></span><br>=0A=
<!--$=0A=
if config.inline_topics_fullpath:=0A=
    for id in topics:=0A=
        --><font size=3D"-1" =
class=3Dinlinetopic><b>&$self.text(u'Topic');:  </b><a =
href=3D"&$topicprfx;&ct=3D&$id;"><!--$=0A=
        write(reports.topic_path(id,ht));--></a>=0A=
<!--$        =0A=
        --></font><br><!--$=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
	#=20
	# 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
-->
=0A=
<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=

<!--$=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=
<!--$=0A=
if extra:=0A=
    --><table cellspacing=3D1 cellpadding=3D0 border=3D0>=0A=
<!--$=0A=
    extralist =3D extra.items()=0A=
    extralist.sort()=0A=
    for key,val in extralist:=0A=
        --><tr valign=3Dbaseline>=0A=
<!--$=0A=
        --><td width=3D"10%"><font size=3D"-1" =
class=3Dextra><i>&$key;</i></font></td>=0A=
<!--$=0A=
        --><td width=3D"90%"><font size=3D"-1" =
class=3Dextra><i>&$val;</i></font></td>=0A=
<!--$=0A=
        --></tr>=0A=
<!--$=0A=
    --></table>=0A=
</td>=0A=
<td width=3D"5%">=0A=
<table cellspacing=3D0 cellpadding=3D0 width=3D80>=0A=
<!--$=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=
            write('|')=0A=
        --></font><!--$=0A=
    if width1>0:=0A=
        --><font size=3D-2 color=3D"#C0C0C0" class=3Drightbar><!--$=0A=
        for wide in range(width2/2):=0A=
            write('|')=0A=
        --></font><!--$=0A=
    --></span></span></td></tr>=0A=
<!--$=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' '))=0A=
    --></span></td></tr>=0A=
<!--$=0A=
if iterms:=0A=
    --><tr><td><font size=3D"-1" class=3Dfs><!--$=0A=
    --><a href=3D"&$fshref;">&$self.text(u'Find Similar');</a><!--$=0A=
    --></font></td></tr>=0A=
<!--$=0A=
for matcher,val in config.compiled_result_icon_alist:=0A=
    if not matcher(url): continue=0A=
    isrc,iwidth,iheight,ihref =3D val=0A=
    --><tr><td><!--$=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=
    --></td></tr>=0A=
<!--$=0A=
    break=0A=
--></table>=0A=
</td>=0A=
</tr>=0A=
</table>=0A=

------=_NextPart_000_000D_01C35122.4188D410--






More information about the Python-list mailing list