Following Sebastian's pyflakes and testing suggestions turned up a few bugs in the _get_uris patch. Changes since v1:
Patch #1: * Fixed: """<summary> to: """ <summary> and converted some from tabs to spaces where I'd missed them in v1. Patch #3: * Fixed docstrings as for patch #1. * Fix 'myuri' → 'uri' in _get_file_uri_tuples. * Fix 'cmirr' → 'm_uri' in _expand_mirror's urlunparse calls. * Fix 'cmirr' → 'locmirr' in _expand_mirror's third_party_mirrors branch. * Move “No known mirror” error from _get_uris to _expand_mirror. * Calculate 'restrict', 'restrict_fetch', 'restrict_mirror', and 'force_mirror' in _get_uris. * Remove 'force_mirror' from fetch, because it's only used in _get_uris. * Fix 'custom_mirrors' → 'custommirrors' in _get_uris invocation. After these changes, runtests.sh passes with only TODO messages on Python 2.7, 3.2, and 3.3, although I'm not sure how thoroughly the test suite covers fetch. There are also a few unrelated: /usr/lib64/python3.3/xml/etree/ElementTree.py:1726: DeprecationWarning: This method of XMLParser is deprecated. Define doctype() method on the TreeBuilder target. parser.feed(data) warnings in the 3.3 results. For folks who prefer Git fetches to the emailed patches, my current series is at: git://tremily.us/portage.git fetch-refactor For those who prefer Git diffs to the above “changes since v1”, the v1 version of this series is tagged in my repository as fetch-refactor-v1. Sebastian, I'd normally cc you directly on v2, but I'm not sure what the Portage team's conventions are here. Let me know if there is a convention, or if you have a personal preference on direct mail vs the list. I think projects that encourage cc-ing tend to have reasonable numbers of NNTP readers, and I don't know where the gentoo-portage-dev@ population falls on that issue. W. Trevor King (3): pym/portage/package/ebuild/fetch.py: Factor out _get_checksum_failure_max_tries pym/portage/package/ebuild/fetch.py: Factor out _get_fetch_resume_size pym/portage/package/ebuild/fetch.py: Factor out _get_uris pym/portage/package/ebuild/fetch.py | 318 +++++++++++++++++++++--------------- 1 file changed, 189 insertions(+), 129 deletions(-) -- 1.8.5.2.8.g0f6c0d1