[Zope] how to display hex data ?

Jonothan Farr jfarr@real.com
Fri, 6 Apr 2001 12:55:38 -0700


Looks like OID is a string. Try <dtml-var expr=3D"_.int(oid)" fmt=3D"%x">
--jfarr

----- Original Message -----
From: "Jose Soares" <jose@sferacarta.com>
To: <hofmann@isl.org>
Cc: <zope@zope.org>
Sent: Friday, April 06, 2001 6:20 AM
Subject: Re: [Zope] how to display hex data ?


> Thank you Kai to reply to may question, I tried using fmt=3D"%x" but Zo=
pe gives
me
> the following message:
>
> TYPE:
>    TypeError
>
> VALUE:
>    illegal argument type for built-in operation
>
> Traceback (innermost last):
>   File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 171, in pub=
lish
>   File /usr/lib/zope/lib/python/ZPublisher/mapply.py, line 160, in mapp=
ly
>     (Object: query1)
>   File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 112, in
call_object
>     (Object: query1)
>   File /usr/lib/zope/lib/python/OFS/DTMLMethod.py, line 172, in __call_=
_
>     (Object: query1)
>   File /usr/lib/zope/lib/python/DocumentTemplate/DT_String.py, line 549=
, in
> __call__
>     (Object: query1)
>   File /usr/lib/zope/lib/python/DocumentTemplate/DT_In.py, line 637, in
renderwb
>     (Object: sql(cmd=3Dcmd_sql))
>   File /usr/lib/zope/lib/python/DocumentTemplate/DT_In.py, line 717, in
renderwob
>     (Object: sequence-item)
>   File /usr/lib/zope/lib/python/DocumentTemplate/DT_Var.py, line 313, i=
n
render
>     (Object: OID)
>     (Info: ('OID', '\325\000\000\000\002\000\000\000', {'fmt': '%x', ''=
:
'OID'}))
> TypeError: illegal argument type for built-in operation
>
>
>
> Any ideas?
>
>
> Kai Hofmann wrote:
>
> > > I'm trying to display hex values without success.
> >
> > >       OID        DISTRETTO
> > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=
=3D=3D=3D
> > > a200000002000100 I10500
> > > a200000002000200 I10500
> > > a200000002000300 I10500
> > > a200000002000400 I10500
> > > a200000002000500 I10500
> > > a200000002000600 I10500
> >
> > I am a stupid beginner, but I would try something like
> >
> > <dtml-var .... fmt=3D"%x">
> >
> > because it seems that C-style printf formatting is supported - if thi=
s does
not
> > work, because ZOPE/python supports only 2-digi hex-values - then try =
to cut
> > your larger numbers into smaller one by "/ $100"
> >
> > Kai
> >
> > --
> > Institut f=FCr Seeverkehrswirtschaft und Logistik   http://www.isl.or=
g/
> > Dipl.-Inform. Kai Hofmann                       mailto:hofmann@isl.or=
g
> > Universitaetsallee GW1 Block A                   phone:+49 421 22096-=
83
> > D-28359 Bremen                                     fax:+49 421 22096-=
55
> >
> > _______________________________________________
> > Zope maillist  -  Zope@zope.org
> > 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 maillist  -  Zope@zope.org
> 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 )
>
>