diff --git a/waflib/Context.py b/waflib/Context.py index 69d18900..04330f3d 100644 --- a/waflib/Context.py +++ b/waflib/Context.py @@ -41,7 +41,6 @@ OUT = 'out' WSCRIPT_FILE = 'wscript' """Name of the waf script files""" - launch_dir = '' """Directory from which waf has been called""" run_dir = '' @@ -53,20 +52,6 @@ out_dir = '' waf_dir = '' """Directory containing the waf modules""" -local_repo = '' -"""Local repository containing additional Waf tools (plugins)""" -remote_repo = 'https://raw.githubusercontent.com/waf-project/waf/master/' -""" -Remote directory containing downloadable waf tools. The missing tools can be downloaded by using:: - - $ waf configure --download -""" - -remote_locs = ['waflib/extras', 'waflib/Tools'] -""" -Remote directories for use with :py:const:`waflib.Context.remote_repo` -""" - g_module = None """ Module representing the main wscript file (see :py:const:`waflib.Context.run_dir`) @@ -82,7 +67,6 @@ List of :py:class:`waflib.Context.Context` subclasses that can be used as waf co are added automatically by a metaclass. """ - def create_context(cmd_name, *k, **kw): """ Create a new :py:class:`waflib.Context.Context` instance corresponding to the given command. @@ -687,7 +671,7 @@ def load_tool(tool, tooldir=None, ctx=None, with_sys_path=True): break except ImportError: x = None - if x is None: # raise an exception + else: # raise an exception __import__(tool) finally: if not with_sys_path: sys.path.remove(waf_dir) diff --git a/waflib/extras/use_config.py b/waflib/extras/use_config.py index b0fd1e73..5eaced24 100644 --- a/waflib/extras/use_config.py +++ b/waflib/extras/use_config.py @@ -50,6 +50,21 @@ import sys import os.path as osp import os +local_repo = '' +"""Local repository containing additional Waf tools (plugins)""" +remote_repo = 'https://raw.githubusercontent.com/waf-project/waf/master/' +""" +Remote directory containing downloadable waf tools. The missing tools can be downloaded by using:: + + $ waf configure --download +""" + +remote_locs = ['waflib/extras', 'waflib/Tools'] +""" +Remote directories for use with :py:const:`waflib.extras.use_config.remote_repo` +""" + + try: from urllib import request except ImportError: @@ -94,12 +109,12 @@ def download_check(node): def download_tool(tool, force=False, ctx=None): """ - Download a Waf tool from the remote repository defined in :py:const:`waflib.Context.remote_repo`:: + Download a Waf tool from the remote repository defined in :py:const:`waflib.extras.use_config.remote_repo`:: $ waf configure --download """ - for x in Utils.to_list(Context.remote_repo): - for sub in Utils.to_list(Context.remote_locs): + for x in Utils.to_list(remote_repo): + for sub in Utils.to_list(remote_locs): url = '/'.join((x, sub, tool + '.py')) try: web = urlopen(url)