text_ux 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +25 -0
- data/.rspec +2 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +51 -0
- data/Rakefile +18 -0
- data/ext/text_ux/extconf.rb +5 -0
- data/ext/text_ux/text_ux.cpp +252 -0
- data/lib/text_ux.rb +5 -0
- data/lib/text_ux/version.rb +3 -0
- data/spec/fixtures/test.ux +0 -0
- data/spec/spec_helper.rb +19 -0
- data/spec/text_ux_spec.rb +137 -0
- data/text_ux.gemspec +26 -0
- data/vendor/ux-trie/ux-0.1.9/.lock-waf_darwin_build +8 -0
- data/vendor/ux-trie/ux-0.1.9/.unittest-gtest/gtest-1.6.0/fused-src/gtest/gtest-all.cc +9118 -0
- data/vendor/ux-trie/ux-0.1.9/.unittest-gtest/gtest-1.6.0/fused-src/gtest/gtest.h +19537 -0
- data/vendor/ux-trie/ux-0.1.9/.unittest-gtest/gtest-1.6.0/fused-src/gtest/gtest_main.cc +39 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Build.py +733 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Build.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/ConfigSet.py +147 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/ConfigSet.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Configure.py +314 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Configure.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Context.py +298 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Context.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Errors.py +37 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Errors.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Logs.py +149 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Logs.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Node.py +500 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Node.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Options.py +130 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Options.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Runner.py +191 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Runner.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Scripting.py +358 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Scripting.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Task.py +669 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Task.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/TaskGen.py +341 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/TaskGen.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/__init__.py +4 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/__init__.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/ar.py +12 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/ar.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/asm.py +25 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/bison.py +29 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/c.py +27 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/c_aliases.py +56 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/c_aliases.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/c_config.py +708 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/c_config.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/c_osx.py +121 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/c_osx.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/c_preproc.py +606 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/c_preproc.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/c_tests.py +110 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/c_tests.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/ccroot.py +372 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/ccroot.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/compiler_c.py +39 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/compiler_cxx.py +39 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/compiler_cxx.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/compiler_d.py +30 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/compiler_fc.py +45 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/cs.py +98 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/cxx.py +27 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/cxx.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/d.py +51 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/d_config.py +47 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/d_scan.py +133 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/dbus.py +30 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/dmd.py +43 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/errcheck.py +153 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/fc.py +123 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/fc_config.py +271 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/fc_scan.py +68 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/flex.py +27 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/g95.py +55 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/gas.py +10 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/gcc.py +98 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/gdc.py +34 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/gfortran.py +69 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/glib2.py +174 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/gnu_dirs.py +65 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/gxx.py +98 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/gxx.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/icc.py +31 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/icpc.py +30 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/ifort.py +42 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/intltool.py +78 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/irixcc.py +49 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/javaw.py +272 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/kde4.py +49 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/lua.py +19 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/msvc.py +650 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/nasm.py +13 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/perl.py +78 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/python.py +303 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/qt4.py +424 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/ruby.py +104 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/suncc.py +54 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/suncxx.py +55 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/tex.py +222 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/vala.py +215 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/waf_unit_test.py +79 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/winres.py +34 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/xlc.py +46 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/xlcxx.py +46 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Utils.py +334 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Utils.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/__init__.py +4 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/__init__.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/ansiterm.py +173 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/ansiterm.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/extras/__init__.py +4 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/extras/__init__.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/extras/compat15.py +223 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/extras/compat15.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/fixpy2.py +50 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/fixpy2.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/src/bitVec.cpp +119 -0
- data/vendor/ux-trie/ux-0.1.9/src/bitVec.hpp +64 -0
- data/vendor/ux-trie/ux-0.1.9/src/bitVecTest.cpp +143 -0
- data/vendor/ux-trie/ux-0.1.9/src/cmdline.h +809 -0
- data/vendor/ux-trie/ux-0.1.9/src/rsDic.cpp +121 -0
- data/vendor/ux-trie/ux-0.1.9/src/rsDic.hpp +57 -0
- data/vendor/ux-trie/ux-0.1.9/src/ux.hpp +26 -0
- data/vendor/ux-trie/ux-0.1.9/src/uxMain.cpp +206 -0
- data/vendor/ux-trie/ux-0.1.9/src/uxMap.cpp +0 -0
- data/vendor/ux-trie/ux-0.1.9/src/uxMap.hpp +248 -0
- data/vendor/ux-trie/ux-0.1.9/src/uxMapTest.cpp +139 -0
- data/vendor/ux-trie/ux-0.1.9/src/uxTest.cpp +229 -0
- data/vendor/ux-trie/ux-0.1.9/src/uxTrie.cpp +529 -0
- data/vendor/ux-trie/ux-0.1.9/src/uxTrie.hpp +220 -0
- data/vendor/ux-trie/ux-0.1.9/src/uxUtil.cpp +92 -0
- data/vendor/ux-trie/ux-0.1.9/src/uxUtil.hpp +35 -0
- data/vendor/ux-trie/ux-0.1.9/src/wscript +43 -0
- data/vendor/ux-trie/ux-0.1.9/unittest_gtest.py +0 -0
- data/vendor/ux-trie/ux-0.1.9/unittest_gtest.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/unittestt.py +166 -0
- data/vendor/ux-trie/ux-0.1.9/ux.pc.in +10 -0
- data/vendor/ux-trie/ux-0.1.9/waf +0 -0
- data/vendor/ux-trie/ux-0.1.9/wscript +32 -0
- metadata +249 -0
Binary file
|
@@ -0,0 +1,298 @@
|
|
1
|
+
#! /usr/bin/env python
|
2
|
+
# encoding: utf-8
|
3
|
+
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
|
4
|
+
|
5
|
+
import os,imp,sys
|
6
|
+
from waflib import Utils,Errors,Logs
|
7
|
+
import waflib.Node
|
8
|
+
HEXVERSION=0x1060800
|
9
|
+
WAFVERSION="1.6.8"
|
10
|
+
WAFREVISION="516a253cbdbb4eef3165c4d47c2074a0fb5dce95"
|
11
|
+
ABI=98
|
12
|
+
DBFILE='.wafpickle-%d'%ABI
|
13
|
+
APPNAME='APPNAME'
|
14
|
+
VERSION='VERSION'
|
15
|
+
TOP='top'
|
16
|
+
OUT='out'
|
17
|
+
WSCRIPT_FILE='wscript'
|
18
|
+
launch_dir=''
|
19
|
+
run_dir=''
|
20
|
+
top_dir=''
|
21
|
+
out_dir=''
|
22
|
+
waf_dir=''
|
23
|
+
local_repo=''
|
24
|
+
remote_repo='http://waf.googlecode.com/git/'
|
25
|
+
remote_locs=['branches/waf-%s/waflib/extras'%WAFVERSION,'trunk/waflib/extras','trunk/waflib/Tools']
|
26
|
+
g_module=None
|
27
|
+
STDOUT=1
|
28
|
+
STDERR=-1
|
29
|
+
BOTH=0
|
30
|
+
classes=[]
|
31
|
+
def create_context(cmd_name,*k,**kw):
|
32
|
+
global classes
|
33
|
+
for x in classes:
|
34
|
+
if x.cmd==cmd_name:
|
35
|
+
return x(*k,**kw)
|
36
|
+
ctx=Context(*k,**kw)
|
37
|
+
ctx.fun=cmd_name
|
38
|
+
return ctx
|
39
|
+
class store_context(type):
|
40
|
+
def __init__(cls,name,bases,dict):
|
41
|
+
super(store_context,cls).__init__(name,bases,dict)
|
42
|
+
name=cls.__name__
|
43
|
+
if name=='ctx'or name=='Context':
|
44
|
+
return
|
45
|
+
try:
|
46
|
+
cls.cmd
|
47
|
+
except AttributeError:
|
48
|
+
raise Errors.WafError('Missing command for the context class %r (cmd)'%name)
|
49
|
+
if not getattr(cls,'fun',None):
|
50
|
+
cls.fun=cls.cmd
|
51
|
+
global classes
|
52
|
+
classes.insert(0,cls)
|
53
|
+
ctx=store_context('ctx',(object,),{})
|
54
|
+
class Context(ctx):
|
55
|
+
errors=Errors
|
56
|
+
tools={}
|
57
|
+
def __init__(self,**kw):
|
58
|
+
try:
|
59
|
+
rd=kw['run_dir']
|
60
|
+
except KeyError:
|
61
|
+
global run_dir
|
62
|
+
rd=run_dir
|
63
|
+
class node_class(waflib.Node.Node):
|
64
|
+
pass
|
65
|
+
self.node_class=node_class
|
66
|
+
self.node_class.__module__="waflib.Node"
|
67
|
+
self.node_class.__name__="Nod3"
|
68
|
+
self.node_class.ctx=self
|
69
|
+
self.root=self.node_class('',None)
|
70
|
+
self.cur_script=None
|
71
|
+
self.path=self.root.find_dir(rd)
|
72
|
+
self.stack_path=[]
|
73
|
+
self.exec_dict={'ctx':self,'conf':self,'bld':self,'opt':self}
|
74
|
+
self.logger=None
|
75
|
+
def __hash__(self):
|
76
|
+
return id(self)
|
77
|
+
def load(self,tool_list,*k,**kw):
|
78
|
+
tools=Utils.to_list(tool_list)
|
79
|
+
path=Utils.to_list(kw.get('tooldir',''))
|
80
|
+
for t in tools:
|
81
|
+
module=load_tool(t,path)
|
82
|
+
fun=getattr(module,kw.get('name',self.fun),None)
|
83
|
+
if fun:
|
84
|
+
fun(self)
|
85
|
+
def execute(self):
|
86
|
+
global g_module
|
87
|
+
self.recurse([os.path.dirname(g_module.root_path)])
|
88
|
+
def pre_recurse(self,node):
|
89
|
+
self.stack_path.append(self.cur_script)
|
90
|
+
self.cur_script=node
|
91
|
+
self.path=node.parent
|
92
|
+
def post_recurse(self,node):
|
93
|
+
self.cur_script=self.stack_path.pop()
|
94
|
+
if self.cur_script:
|
95
|
+
self.path=self.cur_script.parent
|
96
|
+
def recurse(self,dirs,name=None,mandatory=True,once=True):
|
97
|
+
try:
|
98
|
+
cache=self.recurse_cache
|
99
|
+
except:
|
100
|
+
cache=self.recurse_cache={}
|
101
|
+
for d in Utils.to_list(dirs):
|
102
|
+
if not os.path.isabs(d):
|
103
|
+
d=os.path.join(self.path.abspath(),d)
|
104
|
+
WSCRIPT=os.path.join(d,WSCRIPT_FILE)
|
105
|
+
WSCRIPT_FUN=WSCRIPT+'_'+(name or self.fun)
|
106
|
+
node=self.root.find_node(WSCRIPT_FUN)
|
107
|
+
if node and(not once or node not in cache):
|
108
|
+
cache[node]=True
|
109
|
+
self.pre_recurse(node)
|
110
|
+
try:
|
111
|
+
function_code=node.read('rU')
|
112
|
+
exec(compile(function_code,node.abspath(),'exec'),self.exec_dict)
|
113
|
+
finally:
|
114
|
+
self.post_recurse(node)
|
115
|
+
elif not node:
|
116
|
+
node=self.root.find_node(WSCRIPT)
|
117
|
+
if node and(not once or node not in cache):
|
118
|
+
cache[node]=True
|
119
|
+
self.pre_recurse(node)
|
120
|
+
try:
|
121
|
+
wscript_module=load_module(node.abspath())
|
122
|
+
user_function=getattr(wscript_module,(name or self.fun),None)
|
123
|
+
if not user_function:
|
124
|
+
if not mandatory:
|
125
|
+
continue
|
126
|
+
raise Errors.WafError('No function %s defined in %s'%(name or self.fun,node.abspath()))
|
127
|
+
user_function(self)
|
128
|
+
finally:
|
129
|
+
self.post_recurse(node)
|
130
|
+
elif not node:
|
131
|
+
if not mandatory:
|
132
|
+
continue
|
133
|
+
raise Errors.WafError('No wscript file in directory %s'%d)
|
134
|
+
def exec_command(self,cmd,**kw):
|
135
|
+
subprocess=Utils.subprocess
|
136
|
+
kw['shell']=isinstance(cmd,str)
|
137
|
+
Logs.debug('runner: %r'%cmd)
|
138
|
+
Logs.debug('runner_env: kw=%s'%kw)
|
139
|
+
try:
|
140
|
+
if self.logger:
|
141
|
+
self.logger.info(cmd)
|
142
|
+
kw['stdout']=kw['stderr']=subprocess.PIPE
|
143
|
+
p=subprocess.Popen(cmd,**kw)
|
144
|
+
(out,err)=p.communicate()
|
145
|
+
if out:
|
146
|
+
self.logger.debug('out: %s'%out.decode(sys.stdout.encoding or'iso8859-1'))
|
147
|
+
if err:
|
148
|
+
self.logger.error('err: %s'%err.decode(sys.stdout.encoding or'iso8859-1'))
|
149
|
+
return p.returncode
|
150
|
+
else:
|
151
|
+
p=subprocess.Popen(cmd,**kw)
|
152
|
+
return p.wait()
|
153
|
+
except OSError:
|
154
|
+
return-1
|
155
|
+
def cmd_and_log(self,cmd,**kw):
|
156
|
+
subprocess=Utils.subprocess
|
157
|
+
kw['shell']=isinstance(cmd,str)
|
158
|
+
Logs.debug('runner: %r'%cmd)
|
159
|
+
if'quiet'in kw:
|
160
|
+
quiet=kw['quiet']
|
161
|
+
del kw['quiet']
|
162
|
+
else:
|
163
|
+
quiet=None
|
164
|
+
if'output'in kw:
|
165
|
+
to_ret=kw['output']
|
166
|
+
del kw['output']
|
167
|
+
else:
|
168
|
+
to_ret=STDOUT
|
169
|
+
kw['stdout']=kw['stderr']=subprocess.PIPE
|
170
|
+
if quiet is None:
|
171
|
+
self.to_log(cmd)
|
172
|
+
try:
|
173
|
+
p=subprocess.Popen(cmd,**kw)
|
174
|
+
(out,err)=p.communicate()
|
175
|
+
except Exception ,e:
|
176
|
+
raise Errors.WafError('Execution failure: %s'%str(e),ex=e)
|
177
|
+
if not isinstance(out,str):
|
178
|
+
out=out.decode(sys.stdout.encoding or'iso8859-1')
|
179
|
+
if not isinstance(err,str):
|
180
|
+
err=err.decode(sys.stdout.encoding or'iso8859-1')
|
181
|
+
if out and quiet!=STDOUT and quiet!=BOTH:
|
182
|
+
self.to_log('out: %s'%out)
|
183
|
+
if err and quiet!=STDERR and quiet!=BOTH:
|
184
|
+
self.to_log('err: %s'%err)
|
185
|
+
if p.returncode:
|
186
|
+
e=Errors.WafError('Command %r returned %r'%(cmd,p.returncode))
|
187
|
+
e.returncode=p.returncode
|
188
|
+
e.stderr=err
|
189
|
+
e.stdout=out
|
190
|
+
raise e
|
191
|
+
if to_ret==BOTH:
|
192
|
+
return(out,err)
|
193
|
+
elif to_ret==STDERR:
|
194
|
+
return err
|
195
|
+
return out
|
196
|
+
def fatal(self,msg,ex=None):
|
197
|
+
if self.logger:
|
198
|
+
self.logger.info('from %s: %s'%(self.path.abspath(),msg))
|
199
|
+
try:
|
200
|
+
msg='%s\n(complete log in %s)'%(msg,self.logger.handlers[0].baseFilename)
|
201
|
+
except:
|
202
|
+
pass
|
203
|
+
raise self.errors.ConfigurationError(msg,ex=ex)
|
204
|
+
def to_log(self,msg):
|
205
|
+
if not msg:
|
206
|
+
return
|
207
|
+
if self.logger:
|
208
|
+
self.logger.info(msg)
|
209
|
+
else:
|
210
|
+
sys.stderr.write(str(msg))
|
211
|
+
sys.stderr.flush()
|
212
|
+
def msg(self,msg,result,color=None):
|
213
|
+
self.start_msg(msg)
|
214
|
+
if not isinstance(color,str):
|
215
|
+
color=result and'GREEN'or'YELLOW'
|
216
|
+
self.end_msg(result,color)
|
217
|
+
def start_msg(self,msg):
|
218
|
+
try:
|
219
|
+
if self.in_msg:
|
220
|
+
self.in_msg+=1
|
221
|
+
return
|
222
|
+
except:
|
223
|
+
self.in_msg=0
|
224
|
+
self.in_msg+=1
|
225
|
+
try:
|
226
|
+
self.line_just=max(self.line_just,len(msg))
|
227
|
+
except AttributeError:
|
228
|
+
self.line_just=max(40,len(msg))
|
229
|
+
for x in(self.line_just*'-',msg):
|
230
|
+
self.to_log(x)
|
231
|
+
Logs.pprint('NORMAL',"%s :"%msg.ljust(self.line_just),sep='')
|
232
|
+
def end_msg(self,result,color=None):
|
233
|
+
self.in_msg-=1
|
234
|
+
if self.in_msg:
|
235
|
+
return
|
236
|
+
defcolor='GREEN'
|
237
|
+
if result==True:
|
238
|
+
msg='ok'
|
239
|
+
elif result==False:
|
240
|
+
msg='not found'
|
241
|
+
defcolor='YELLOW'
|
242
|
+
else:
|
243
|
+
msg=str(result)
|
244
|
+
self.to_log(msg)
|
245
|
+
Logs.pprint(color or defcolor,msg)
|
246
|
+
def load_special_tools(self,var,ban=[]):
|
247
|
+
global waf_dir
|
248
|
+
lst=self.root.find_node(waf_dir).find_node('waflib/extras').ant_glob(var)
|
249
|
+
for x in lst:
|
250
|
+
if not x.name in ban:
|
251
|
+
load_tool(x.name.replace('.py',''))
|
252
|
+
cache_modules={}
|
253
|
+
def load_module(path):
|
254
|
+
try:
|
255
|
+
return cache_modules[path]
|
256
|
+
except KeyError:
|
257
|
+
pass
|
258
|
+
module=imp.new_module(WSCRIPT_FILE)
|
259
|
+
try:
|
260
|
+
code=Utils.readf(path,m='rU')
|
261
|
+
except(IOError,OSError):
|
262
|
+
raise Errors.WafError('Could not read the file %r'%path)
|
263
|
+
module_dir=os.path.dirname(path)
|
264
|
+
sys.path.insert(0,module_dir)
|
265
|
+
exec(compile(code,path,'exec'),module.__dict__)
|
266
|
+
sys.path.remove(module_dir)
|
267
|
+
cache_modules[path]=module
|
268
|
+
return module
|
269
|
+
def load_tool(tool,tooldir=None):
|
270
|
+
tool=tool.replace('++','xx')
|
271
|
+
tool=tool.replace('java','javaw')
|
272
|
+
tool=tool.replace('compiler_cc','compiler_c')
|
273
|
+
if tooldir:
|
274
|
+
assert isinstance(tooldir,list)
|
275
|
+
sys.path=tooldir+sys.path
|
276
|
+
try:
|
277
|
+
__import__(tool)
|
278
|
+
ret=sys.modules[tool]
|
279
|
+
Context.tools[tool]=ret
|
280
|
+
return ret
|
281
|
+
finally:
|
282
|
+
for d in tooldir:
|
283
|
+
sys.path.remove(d)
|
284
|
+
else:
|
285
|
+
global waf_dir
|
286
|
+
try:
|
287
|
+
os.stat(os.path.join(waf_dir,'waflib','extras',tool+'.py'))
|
288
|
+
d='waflib.extras.%s'%tool
|
289
|
+
except:
|
290
|
+
try:
|
291
|
+
os.stat(os.path.join(waf_dir,'waflib','Tools',tool+'.py'))
|
292
|
+
d='waflib.Tools.%s'%tool
|
293
|
+
except:
|
294
|
+
d=tool
|
295
|
+
__import__(d)
|
296
|
+
ret=sys.modules[d]
|
297
|
+
Context.tools[tool]=ret
|
298
|
+
return ret
|
Binary file
|
@@ -0,0 +1,37 @@
|
|
1
|
+
#! /usr/bin/env python
|
2
|
+
# encoding: utf-8
|
3
|
+
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
|
4
|
+
|
5
|
+
import traceback,sys
|
6
|
+
class WafError(Exception):
|
7
|
+
def __init__(self,msg='',ex=None):
|
8
|
+
self.msg=msg
|
9
|
+
assert not isinstance(msg,Exception)
|
10
|
+
self.stack=[]
|
11
|
+
if ex:
|
12
|
+
if not msg:
|
13
|
+
self.msg=str(ex)
|
14
|
+
if isinstance(ex,WafError):
|
15
|
+
self.stack=ex.stack
|
16
|
+
else:
|
17
|
+
self.stack=traceback.extract_tb(sys.exc_info()[2])
|
18
|
+
self.stack+=traceback.extract_stack()[:-1]
|
19
|
+
self.verbose_msg=''.join(traceback.format_list(self.stack))
|
20
|
+
def __str__(self):
|
21
|
+
return str(self.msg)
|
22
|
+
class BuildError(WafError):
|
23
|
+
def __init__(self,error_tasks=[]):
|
24
|
+
self.tasks=error_tasks
|
25
|
+
WafError.__init__(self,self.format_error())
|
26
|
+
def format_error(self):
|
27
|
+
lst=['Build failed']
|
28
|
+
for tsk in self.tasks:
|
29
|
+
txt=tsk.format_error()
|
30
|
+
if txt:lst.append(txt)
|
31
|
+
return'\n'.join(lst)
|
32
|
+
class ConfigurationError(WafError):
|
33
|
+
pass
|
34
|
+
class TaskRescan(WafError):
|
35
|
+
pass
|
36
|
+
class TaskNotReady(WafError):
|
37
|
+
pass
|
Binary file
|
@@ -0,0 +1,149 @@
|
|
1
|
+
#! /usr/bin/env python
|
2
|
+
# encoding: utf-8
|
3
|
+
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
|
4
|
+
|
5
|
+
import os,re,traceback,sys
|
6
|
+
_nocolor=os.environ.get('NOCOLOR','no')not in('no','0','false')
|
7
|
+
try:
|
8
|
+
if not _nocolor:
|
9
|
+
import waflib.ansiterm
|
10
|
+
except:
|
11
|
+
pass
|
12
|
+
import logging
|
13
|
+
LOG_FORMAT="%(asctime)s %(c1)s%(zone)s%(c2)s %(message)s"
|
14
|
+
HOUR_FORMAT="%H:%M:%S"
|
15
|
+
zones=''
|
16
|
+
verbose=0
|
17
|
+
colors_lst={'USE':True,'BOLD':'\x1b[01;1m','RED':'\x1b[01;31m','GREEN':'\x1b[32m','YELLOW':'\x1b[33m','PINK':'\x1b[35m','BLUE':'\x1b[01;34m','CYAN':'\x1b[36m','NORMAL':'\x1b[0m','cursor_on':'\x1b[?25h','cursor_off':'\x1b[?25l',}
|
18
|
+
got_tty=not os.environ.get('TERM','dumb')in['dumb','emacs']
|
19
|
+
if got_tty:
|
20
|
+
try:
|
21
|
+
got_tty=sys.stderr.isatty()
|
22
|
+
except AttributeError:
|
23
|
+
got_tty=False
|
24
|
+
if(not got_tty and os.environ.get('TERM','dumb')!='msys')or _nocolor:
|
25
|
+
colors_lst['USE']=False
|
26
|
+
def get_term_cols():
|
27
|
+
return 80
|
28
|
+
try:
|
29
|
+
import struct,fcntl,termios
|
30
|
+
except ImportError:
|
31
|
+
pass
|
32
|
+
else:
|
33
|
+
if got_tty:
|
34
|
+
def get_term_cols_real():
|
35
|
+
dummy_lines,cols=struct.unpack("HHHH",fcntl.ioctl(sys.stderr.fileno(),termios.TIOCGWINSZ,struct.pack("HHHH",0,0,0,0)))[:2]
|
36
|
+
return cols
|
37
|
+
try:
|
38
|
+
get_term_cols_real()
|
39
|
+
except:
|
40
|
+
pass
|
41
|
+
else:
|
42
|
+
get_term_cols=get_term_cols_real
|
43
|
+
get_term_cols.__doc__="""
|
44
|
+
Get the console width in characters.
|
45
|
+
|
46
|
+
:return: the number of characters per line
|
47
|
+
:rtype: int
|
48
|
+
"""
|
49
|
+
def get_color(cl):
|
50
|
+
if not colors_lst['USE']:return''
|
51
|
+
return colors_lst.get(cl,'')
|
52
|
+
class color_dict(object):
|
53
|
+
def __getattr__(self,a):
|
54
|
+
return get_color(a)
|
55
|
+
def __call__(self,a):
|
56
|
+
return get_color(a)
|
57
|
+
colors=color_dict()
|
58
|
+
re_log=re.compile(r'(\w+): (.*)',re.M)
|
59
|
+
class log_filter(logging.Filter):
|
60
|
+
def __init__(self,name=None):
|
61
|
+
pass
|
62
|
+
def filter(self,rec):
|
63
|
+
rec.c1=colors.PINK
|
64
|
+
rec.c2=colors.NORMAL
|
65
|
+
rec.zone=rec.module
|
66
|
+
if rec.levelno>=logging.INFO:
|
67
|
+
if rec.levelno>=logging.ERROR:
|
68
|
+
rec.c1=colors.RED
|
69
|
+
elif rec.levelno>=logging.WARNING:
|
70
|
+
rec.c1=colors.YELLOW
|
71
|
+
else:
|
72
|
+
rec.c1=colors.GREEN
|
73
|
+
return True
|
74
|
+
m=re_log.match(rec.msg)
|
75
|
+
if m:
|
76
|
+
rec.zone=m.group(1)
|
77
|
+
rec.msg=m.group(2)
|
78
|
+
if zones:
|
79
|
+
return getattr(rec,'zone','')in zones or'*'in zones
|
80
|
+
elif not verbose>2:
|
81
|
+
return False
|
82
|
+
return True
|
83
|
+
class formatter(logging.Formatter):
|
84
|
+
def __init__(self):
|
85
|
+
logging.Formatter.__init__(self,LOG_FORMAT,HOUR_FORMAT)
|
86
|
+
def format(self,rec):
|
87
|
+
if rec.levelno>=logging.WARNING or rec.levelno==logging.INFO:
|
88
|
+
try:
|
89
|
+
msg=rec.msg.decode('utf-8')
|
90
|
+
except:
|
91
|
+
msg=rec.msg
|
92
|
+
return'%s%s%s'%(rec.c1,msg,rec.c2)
|
93
|
+
return logging.Formatter.format(self,rec)
|
94
|
+
log=None
|
95
|
+
def debug(*k,**kw):
|
96
|
+
if verbose:
|
97
|
+
k=list(k)
|
98
|
+
k[0]=k[0].replace('\n',' ')
|
99
|
+
global log
|
100
|
+
log.debug(*k,**kw)
|
101
|
+
def error(*k,**kw):
|
102
|
+
global log
|
103
|
+
log.error(*k,**kw)
|
104
|
+
if verbose>2:
|
105
|
+
st=traceback.extract_stack()
|
106
|
+
if st:
|
107
|
+
st=st[:-1]
|
108
|
+
buf=[]
|
109
|
+
for filename,lineno,name,line in st:
|
110
|
+
buf.append(' File "%s", line %d, in %s'%(filename,lineno,name))
|
111
|
+
if line:
|
112
|
+
buf.append(' %s'%line.strip())
|
113
|
+
if buf:log.error("\n".join(buf))
|
114
|
+
def warn(*k,**kw):
|
115
|
+
global log
|
116
|
+
log.warn(*k,**kw)
|
117
|
+
def info(*k,**kw):
|
118
|
+
global log
|
119
|
+
log.info(*k,**kw)
|
120
|
+
def init_log():
|
121
|
+
global log
|
122
|
+
log=logging.getLogger('waflib')
|
123
|
+
log.handlers=[]
|
124
|
+
log.filters=[]
|
125
|
+
hdlr=logging.StreamHandler()
|
126
|
+
hdlr.setFormatter(formatter())
|
127
|
+
log.addHandler(hdlr)
|
128
|
+
log.addFilter(log_filter())
|
129
|
+
log.setLevel(logging.DEBUG)
|
130
|
+
def make_logger(path,name):
|
131
|
+
logger=logging.getLogger(name)
|
132
|
+
hdlr=logging.FileHandler(path,'w')
|
133
|
+
formatter=logging.Formatter('%(message)s')
|
134
|
+
hdlr.setFormatter(formatter)
|
135
|
+
logger.addHandler(hdlr)
|
136
|
+
logger.setLevel(logging.DEBUG)
|
137
|
+
return logger
|
138
|
+
def make_mem_logger(name,to_log,size=10000):
|
139
|
+
from logging.handlers import MemoryHandler
|
140
|
+
logger=logging.getLogger(name)
|
141
|
+
hdlr=MemoryHandler(size,target=to_log)
|
142
|
+
formatter=logging.Formatter('%(message)s')
|
143
|
+
hdlr.setFormatter(formatter)
|
144
|
+
logger.addHandler(hdlr)
|
145
|
+
logger.memhandler=hdlr
|
146
|
+
logger.setLevel(logging.DEBUG)
|
147
|
+
return logger
|
148
|
+
def pprint(col,str,label='',sep='\n'):
|
149
|
+
sys.stderr.write("%s%s%s %s%s"%(colors(col),str,colors.NORMAL,label,sep))
|