On Tue, Jun 10, 2008 at 11:50:47AM -0700, [EMAIL PROTECTED] wrote:
> http://cr.opensolaris.org/~johansen/pkg-timeout/
I wonder if the Image class should get a method that handles all the cache
path bits internally, returning either a path, or a file handle, or an
opener (the first and third being the useful ones in the filelist context).
filelist.py:
- _add_action() should have a different docstring from add_action().
Maybe the latter should mention something about pulling from cache.
- line 118: why bother with the try block here, if all you're going to do
is unconditionally re-raise the exception?
- line 159: merge this if with the actual lookup in a try/except block
(and return if you catch a KeyError).
- line 171: Couldn't this loop simply be
self.effective_nfiles -= len(act_list)
self.effective_bytes -= len(act_list) *
int(act_list[0].attrs.get("pkg.size", "0"))
where that last factor could be shared in a variable with where
actual_bytes is reduced?
- line 202, 203: Use -= here? Not important, but that's what you're
doing in most other places.
- line 220: This comment should be associated with the next code block, I
think.
- line 323: this is always going to be all of them, right? Is the idea
that at some point you'll be able to return to the caller early with a
smaller number, rather than raising an exception? (Useful, I guess,
only when you don't restart each filelist from the beginning?)
image.py:
- line 455: this needs a better distinguishing name from
_fetch_manifest(). This gives us _fetch_manifest, _do_fetch_manifest,
and get_manifest in various modules. It's not quite as exciting as
XXX_matching_pkgs yet, but that's not a good goal.
- line 494: I'm not sure that TransferInterruptedException is really the
right name here. TransferTimedOutException, maybe? Or even just leave
it as socket.timeout? Unless you're using the same exception in other
cases where a transfer was interrupted.
- docstrings for incoming_download_dir(), cached_download_dir(),
cleanup_downloads(), cleanup_cached_content(), please.
misc.py:
- line 317: spaces around "=".
Danek
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss