Brock Pytlik wrote:
http://cr.opensolaris.org/~bpytlik/ips-2670-v1/
imageplan.py: 591
imageplan.py: 770
imageplan.py: 797
Rather than consing up your own exclude list, please use the right
one (new_excludes or old_excludes) that's part of the imageplan.
That way when we add facets or someone installs in a zone, the right
thing happens automagically.
generic.py: 276
Please update comment regarding return value of generate_indices
Return value is now a list of tuples... and isn't documented.
manifest.py: 370
Why not add include_this to generic.py as a method for all actions:
def include_this(self, excludes):
""" given a list of callables, return False if any return
false when applied to this action, otherwise True """
for c in excludes:
if not c(self):
return False
return True
(I should have done that when I added this originally.)
In general, your code could really use more comments. At a minimum,
a doc string is needed per function.
Contrast
236 237 def get_file_handle(self):
237 238 """Return the file handle. Note that doing
238 239 anything other than sequential reads or writes
239 240 to or from this file_handle may result in
unexpected
240 241 behavior. In short, don't use seek.
241 242 """
242 243 return self._file_handle
with:
244 245 @staticmethod
246 + def __parse_main_dict_line_help(split_chars,
unquote_list, line):
247 + if not split_chars:
248 + if not line or not unquote_list:
249 + raise RuntimeError("Should
never get here")
250 + else:
251 + assert len(unquote_list) == 1
252 + if unquote_list[0]:
253 + return
urllib.unquote(line)
254 + else:
255 + return line
256 + else:
257 + cur_char = split_chars[0]
258 + tmp = line.split(cur_char)
259 + if unquote_list[0]:
260 + header = urllib.unquote(tmp[0])
261 + else:
262 + header = tmp[0]
263 + return (header, [
264 +
IndexStoreMainDict.__parse_main_dict_line_help(
265 + split_chars[1:],
unquote_list[1:], x)
266 + for x
267 + in tmp[1:]])
268 +
- Bart
--
Bart Smaalders Solaris Kernel Performance
[email protected] http://blogs.sun.com/barts
"You will contribute more with mercurial than with thunderbird."
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss