Update project files to build with libuv and the timer module

This commit is contained in:
Rohan Singh
2015-08-13 01:39:34 -04:00
parent 8e791c70c0
commit ad60a7e46e
3 changed files with 35 additions and 10 deletions
+21 -4
View File
@@ -22,6 +22,25 @@ def ensure_dir(dir):
os.makedirs(dir)
def rmtree_onerror(func, path, exc_info):
"""
Error handler for ``shutil.rmtree``.
If the error is due to an access error (read only file)
it attempts to add write permission and then retries.
If the error is for another reason it re-raises the error.
Usage : ``shutil.rmtree(path, onerror=rmtree_onerror)``
"""
import stat
if not os.access(path, os.W_OK):
# Is the error an access error?
os.chmod(path, stat.S_IWUSR)
func(path)
else:
raise
def download_libuv():
"""Clones libuv into build/libuv and checks out the right version."""
@@ -30,7 +49,7 @@ def download_libuv():
# version number in this script changes.
if os.path.isdir(LIB_UV_DIR):
print("Cleaning output directory...")
shutil.rmtree(LIB_UV_DIR)
shutil.rmtree(LIB_UV_DIR, onerror=rmtree_onerror)
ensure_dir("build")
@@ -84,9 +103,7 @@ def build_libuv_linux():
def build_libuv_windows():
# TODO: Implement me!
print("Building for Windows not implemented yet.")
sys.exit(1)
run(["cmd", "/c", "vcbuild.bat", "release"], cwd=LIB_UV_DIR)
def build_libuv():