[Sugar-devel] [PATCH] Wireless key dialog: Translate more strings (OLPC#9268)
Chris Leonard
cjlhomeaddress at gmail.com
Wed Sep 14 15:01:19 EDT 2011
On Wed, Sep 14, 2011 at 1:32 PM, Daniel Drake <dsd at laptop.org> wrote:
> On Mon, Aug 1, 2011 at 6:11 PM, Sascha Silbe <silbe at activitycentral.com> wrote:
>> As you are already touching this code, please consider replacing the %s
>> with %r (the difference is in how strings containing special characters
>> and quotes get displayed) and using a singleton tuple for the string
>> formatting parameter (self._ssid) for consistency with other code.
>
> %s seems to match the way that names are displayed in other parts of
> the UI, so I will stick with that.
>
> I don't understand your comment about using a singleton tuple - can
> you explain or show me the code that you refer to? Are you suggesting
> packing it into a tuple and using some kind of alternative to %r/%s
> that peeks into the tuple?
>
http://docs.python.org/release/2.2.1/lib/typesseq-strings.html
explains that
%r String (converts any python object using repr())
%s String (converts any python object using str()).
tuples (and singleton tuples) are also discussed on the link above.
cjl
More information about the Sugar-devel
mailing list