From 406f89271452fdb573c7e28113b1ed08ff2b4eda Mon Sep 17 00:00:00 2001 From: David Robillard <d@drobilla.net> Date: Sun, 17 Mar 2019 17:31:05 +0100 Subject: Squashed 'waflib/' changes from 915dcb1..e7a29b6 e7a29b6 Upgrade to waf 2.0.15 8280f9d Add command for running executables from the build directory 8073c1a Make make_simple_dox() safe in case of exception 70d03b8 Avoid use of global counter hacks for configuration display b7d689a Rewrite test framework 94deadf Automatically add options and move add_flags() to options context f4259ee Reduce system include path noise 927b608 Automatically display configuration header c44b8f3 Set line justification from a constant in the wscript a48e26f Automatically detect if wscript has a test hook ef66724 Save runtime variables in the environment 63bcbcd Clean up TestContext b1d9505 Add ExecutionContext for setting runtime environment 387c1df Add show_diff() and test_file_equals() utilities 29d4d29 Fix in-tree library paths 9fde01f Add custom configuration context 6d3612f Add lib_path_name constant git-subtree-dir: waflib git-subtree-split: e7a29b6b9b2f842314244c23c14d8f8f560904e1 --- waflib/fixpy2.py | 64 -------------------------------------------------------- 1 file changed, 64 deletions(-) delete mode 100644 waflib/fixpy2.py (limited to 'waflib/fixpy2.py') diff --git a/waflib/fixpy2.py b/waflib/fixpy2.py deleted file mode 100644 index 24176e0..0000000 --- a/waflib/fixpy2.py +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env python -# encoding: utf-8 -# Thomas Nagy, 2010-2018 (ita) - -from __future__ import with_statement - -import os - -all_modifs = {} - -def fixdir(dir): - """Call all substitution functions on Waf folders""" - for k in all_modifs: - for v in all_modifs[k]: - modif(os.path.join(dir, 'waflib'), k, v) - -def modif(dir, name, fun): - """Call a substitution function""" - if name == '*': - lst = [] - for y in '. Tools extras'.split(): - for x in os.listdir(os.path.join(dir, y)): - if x.endswith('.py'): - lst.append(y + os.sep + x) - for x in lst: - modif(dir, x, fun) - return - - filename = os.path.join(dir, name) - with open(filename, 'r') as f: - txt = f.read() - - txt = fun(txt) - - with open(filename, 'w') as f: - f.write(txt) - -def subst(*k): - """register a substitution function""" - def do_subst(fun): - for x in k: - try: - all_modifs[x].append(fun) - except KeyError: - all_modifs[x] = [fun] - return fun - return do_subst - -@subst('*') -def r1(code): - "utf-8 fixes for python < 2.6" - code = code.replace('as e:', ',e:') - code = code.replace(".decode(sys.stdout.encoding or'latin-1',errors='replace')", '') - return code.replace('.encode()', '') - -@subst('Runner.py') -def r4(code): - "generator syntax" - return code.replace('next(self.biter)', 'self.biter.next()') - -@subst('Context.py') -def r5(code): - return code.replace("('Execution failure: %s'%str(e),ex=e)", "('Execution failure: %s'%str(e),ex=e),None,sys.exc_info()[2]") - -- cgit v1.2.1