[Zope] Changing tree icon colors

Martijn Pieters mj@antraciet.nl
Thu, 08 Jul 1999 11:17:40 +0200


--=====================_236772290==_
Content-Type: text/plain; charset="us-ascii"; format=flowed

At 10:47 08/07/99 , you wrote:
>Martijn,
>I'm appreciative of you doing this, but none of the patches will work on 
>the zope distributions I have. I just want to check I'm not being daft here.
>
>I've tried on Zope-1.10.2-solaris-2.5.1-sparc, Zope 1.10.3, Zope 2.0a3 and 
>the CVS version. Here's the output from a Zope 1.10.3 distribution; patch 
>is the first patch, whilst patch2 is the second one you sent.

Try the attached file. I seem to have problems with either IRIX diff or 
with linewrapping in emails... The patch is generated by CVS diff, and 
atachments don't suffer from wrapperitis. It should patch 1.10.3 TreeTag.py 
to support childless_decoration, openened_decoration and closed_decoration 
attributes.

--=====================_236772290==_
Content-Type: text/plain; charset="iso-8859-1"
Content-Disposition: attachment; filename="TreeTag-1.10.3.patch"
Content-Transfer-Encoding: quoted-printable

***************=0A*** 99,104 ****=0A--- 99,107 ----=0A =
 tplus=3Dtbl[:ord('+')]+'-'+tbl[ord('+')+1:]=0A =
 tminus=3Dtbl[:ord('-')]+'+'+tbl[ord('-')+1:]=0A=0A+ plus_icon =3D=
 '/p_/pl'=0A+ minus_icon =3D '/p_/mi'=0A+=0A  class Tree:=0A     =
 name=3D'tree'=0A      blockContinuations=3D()=0A***************=0A***=
 112,120 ****=0A                            branches=3DNone,=
 branches_expr=3DNone,=0A                            sort=3DNone, reverse=3D=
1, skip_unauthorized=3D1,=0A                            id=3DNone, single=3D=
1, url=3DNone,=0A!                           # opened_decoration=3DNone,=0A!=
                           # closed_decoration=3DNone,=0A!                  =
         # childless_decoration=3DNone,=0A                           =
 assume_children=3D1)=0A          has_key=3Dargs.has_key=0A=0A--- 115,123=
 ----=0A                            branches=3DNone, branches_expr=3DNone,=
=0A                            sort=3DNone, reverse=3D1,=
 skip_unauthorized=3D1,=0A                            id=3DNone, single=3D1,=
 url=3DNone,=0A!                           opened_decoration=3DNone,=0A!    =
                       closed_decoration=3DNone,=0A!                        =
   childless_decoration=3DNone,=0A                           =
 assume_children=3D1)=0A          has_key=3Dargs.has_key=0A=0A**************=
*=0A*** 132,137 ****=0A--- 135,144 ----=0A=0A          if not has_key('id'):=
 args['id']=3D'tpId'=0A          if not has_key('url'):=
 args['url']=3D'tpURL'=0A+         if not has_key('opened_decoration'):=0A+ =
            args['opened_decoration']=3Dminus_icon=0A+         if not=
 has_key('closed_decoration'):=0A+            =
 args['closed_decoration']=3Dplus_icon=0A          if not=
 has_key('childless_decoration'):=0A             =
 args['childless_decoration']=3D''=0A=0A***************=0A*** 377,397 ****=
=0A              script=3Dmd['SCRIPT_NAME']=0A              if exp:=0A      =
            treeData['tree-item-expanded']=3D1=0A                 =
 output('<A NAME=3D"%s">'=0A                         '<A=
 HREF=3D"%s?tree-c=3D%s#%s">'=0A!                        '<IMG=
 SRC=3D"%s/p_/mi" BORDER=3D0></A></A>' %=0A!                        (id,=
 root_url, s, id, script))=0A              else:=0A                 =
 output('<A NAME=3D"%s">'=0A                         '<A=
 HREF=3D"%s?tree-e=3D%s#%s">'=0A!                        '<IMG=
 SRC=3D"%s/p_/pl" BORDER=3D0></A></A>' %=0A!                        (id,=
 root_url, s, id, script))=0A              output('</TD>\n')=0A=0A         =
 else:=0A              if level > 2: output('<TD COLSPAN=3D"%s"></TD>' %=
 level)=0A              elif level > 0: output('<TD></TD>' * level)=0A!     =
        output('<TD WIDTH=3D"16"></TD>\n')=0A=0A=0A          # add item=
 text=0A--- 384,414 ----=0A              script=3Dmd['SCRIPT_NAME']=0A      =
        if exp:=0A                  treeData['tree-item-expanded']=3D1=0A+  =
               if have_arg('opened_decoration'):=0A+                    =
 icon=3Dargs['opened_decoration']=0A+                 else: icon=3Dminus_ico=
n=0A                  output('<A NAME=3D"%s">'=0A                        =
 '<A HREF=3D"%s?tree-c=3D%s#%s">'=0A!                        '<IMG=
 SRC=3D"%s%s" BORDER=3D0></A></A>' %=0A!                        (id,=
 root_url, s, id, script, icon))=0A              else:=0A+                =
 if have_arg('closed_decoration'):=0A+                    =
 icon=3Dargs['closed_decoration']=0A+                 else: icon=3Dplus_icon=
=0A                  output('<A NAME=3D"%s">'=0A                         '<A=
 HREF=3D"%s?tree-e=3D%s#%s">'=0A!                        '<IMG SRC=3D"%s%s"=
 BORDER=3D0></A></A>' %=0A!                        (id, root_url, s, id,=
 script, icon))=0A              output('</TD>\n')=0A=0A          else:=0A   =
           if level > 2: output('<TD COLSPAN=3D"%s"></TD>' % level)=0A      =
        elif level > 0: output('<TD></TD>' * level)=0A!             if=
 have_arg('childless_decoration') and args['childless_decoration']:=0A!     =
            output('<TD WIDTH=3D"16"><IMG SRC=3D"%s%s"></TD>\n' %=0A!       =
                 (md['SCRIPT_NAME'], args['childless_decoration']))=0A!     =
        else:=0A!                 output('<TD WIDTH=3D"16"></TD>\n')=0A=0A=
=0A          # add item text=0A***************=0A*** 648,656 ****=0A     =
 return r=0A=0A=0A- #icoSpace=3D'<IMG SRC=3D"Blank_icon" BORDER=3D"0">'=0A-=
 #icoPlus =3D'<IMG SRC=3D"Plus_icon" BORDER=3D"0">'=0A- #icoMinus=3D'<IMG=
 SRC=3D"Minus_icon" BORDER=3D"0">'=0A=0A=0A=0A--- 665,670 ----=0A
--=====================_236772290==_
Content-Type: text/plain; charset="us-ascii"; format=flowed

--
Martijn Pieters, Web Developer
| Antraciet http://www.antraciet.nl
| Tel: +31-35-7502100 Fax: +31-35-7502111
| mailto:mj@antraciet.nl http://www.antraciet.nl/~mj
| PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149
------------------------------------------
--=====================_236772290==_--