Don't add the bundled Python distribution as a candidate for the Python feed
[zeroinstall/solver.git] / _download_child
blobd7879f734615db7e6e6c6438b2fa964be50d423b
1 #!/usr/bin/env python
2 import sys, os
4 # Add ZIP library to search path in case of direct launch without py2exe
5 libraryZip = os.path.join(os.path.dirname(sys.argv[0]), 'library.zip')
6 if os.path.exists(libraryZip):
7 sys.path.append(libraryZip)
9 assert (len(sys.argv) == 2) or (len(sys.argv) == 3), "Usage: download URL [If-Modified-Since-Date], not %s" % sys.argv
10 if len(sys.argv) >= 3:
11 if_modified_since_date = sys.argv[2]
12 else:
13 if_modified_since_date = None
15 # Don't convert linebreaks to Windows style since this would invalidate the GPG signatures
16 if os.name == "nt":
17 import msvcrt
18 msvcrt.setmode(1, os.O_BINARY)
20 from zeroinstall.injector import _download_child
21 _download_child._download_as_child(sys.argv[1], if_modified_since_date)