use python rewrite download_patchfile.py and apply_patchfile.py