Marking translatable strings

Darrell news at dorb.com
Tue Sep 21 21:44:33 EDT 1999


Tweaked PyString_Format to do it. Posting can be motivational.

>>> d1={'AA':'aa'}
>>> d2={'BB':'bb'}
>>> d3={'CC':'cc'}
>>>
>>> s= fmt("%(AA)s %(BB)s %(CC)s",d1)
>>> print s
aa %(BB)s %(CC)s
>>> s= fmt(s,d2)
>>> print s
aa bb %(CC)s
>>> s= fmt(s,d3)
>>> print s
aa bb cc
--
--Darrell
Aahz Maruch <aahz at netcom.com> wrote in message
news:7s94hn$rjj at dfw-ixnews3.ix.netcom.com...
> In article <1aUF3.223$46.6340 at typhoon.nyroc.rr.com>,
> Darrell <news at dorb.com> wrote:
> >
> >Wish there was a dictionary formatter that wouldn't throw a keyError when
it
> >was missing a value. Then I could avoid the $& kluge. Better yet accept
an
> >error handler function. If the function isn't provided then throw the
error.
>
> How about using try/except?
> --
>                       --- Aahz (@netcom.com)
>
> Androgynous poly kinky vanilla queer het    <*>
http://www.rahul.net/aahz/
> Hugs and backrubs -- I break Rule 6  (if you want to know, do some
research)






More information about the Python-list mailing list