Hi Danek,
On 10/26/12 09:20 PM, Danek Duvall wrote:
https://cr.opensolaris.org/action/browse/pkg/timf/l10n-cleanup/
Thanks for the review, much appreciated.
setup.py:
- You don't use StringIO.
Oops fixed - I'd added that while testing and had forgotten to remove it.
client.py:
- you use "str(e)" a lot, even though this should be covered by the %s
format, and even though it wasn't always there before. Here and in
other files.
Thanks, that was something I'd meant to check (whether objects added to
a parameter-dictionary were correctly stringified by %)
- line 1387: need a space between "%" and "{"
Fixed.
pkg_solver.py:
- line 1715: not necessarily for RTL languages.
Good point, fixed.
progress.py:
- line 1757: this probably still needs translation for RTL languages.
Yes - this was tricky, as xgettext wasn't allowing for the (field-width,
message) tuple format used by %*s, thinking it was an incorrect use of
parameterized messages. I'll add a note thus:
# The following string was originally expressed as
# "%*s: " % \
# (self.phase_max_width, self.phase_names[self.major_phase])
# however xgettext incorrectly flags this as an improper use of
# non-parameterized messages, which gets detected as an error
# during our build. So instead, we express the string using
# an equivalent <str>.format(..) function
s = _("{phase:>%d}: ") % self.phase_max_width
return s.format(phase=self.phase_names[self.major_phase])
We can see these are equivalent with the following:
--
#!/usr/bin/python
import gettext
gettext.install("/")
s = _("%*s: ") % (30, "install")
width = 30
x = _("{phase:>%d}:") % width
y = x.format(phase="install")
print s
print y
--
- line 1974: no need for a continuation character
Thanks.
I'll not put this back till tomorrow in case anyone has a better way of
avoiding that awkward use of format(..)
cheers,
tim
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss