On Tue, Aug 05, 2008 at 12:55:06AM -0500, Shawn Walker wrote:
> http://cr.opensolaris.org/~swalker/pkg-1324-6
depot.py:
- line 129: why set opt here?
- line 181: double quotes
misc.py:
- line 330: Could you stretch this out into multiple lines? That is:
units = [
(a, b),
(c, d),
]
And the "kilo" prefix "k" is lowercase. Though I wonder if it wouldn't
be cleaner to set units up as a dictionary:
units = {
10: "B",
20: "kB",
30: "MB", ...
}
and then do a bit of math:
units.get(divmod(int(math.log(bytes) / math.log(2)), 10)[0] * 10, "EB")
but maybe it's slower or less robust, I dunno. I think once you can
agree that the code is correct, the idea is simpler. But that may just
be me.
- line 337: No need for outer parens, use double quotes.
- line 338, 351: double quotes.
repository.py:
- line 548: "newline"? Really?
updatelog.py:
- line 424: why not split(None, 2), and then you don't have to re-join on
line 429? Though actually, why do the split at all? Why not have
_gen_updates() yield the rich data structure, and then have
_send_updates() massage them into a single line?
Danek
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss