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
|
Binary file
|
@@ -0,0 +1,173 @@
|
|
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 sys,os
|
6
|
+
try:
|
7
|
+
if not(sys.stderr.isatty()and sys.stdout.isatty()):
|
8
|
+
raise ValueError('not a tty')
|
9
|
+
from ctypes import*
|
10
|
+
class COORD(Structure):
|
11
|
+
_fields_=[("X",c_short),("Y",c_short)]
|
12
|
+
class SMALL_RECT(Structure):
|
13
|
+
_fields_=[("Left",c_short),("Top",c_short),("Right",c_short),("Bottom",c_short)]
|
14
|
+
class CONSOLE_SCREEN_BUFFER_INFO(Structure):
|
15
|
+
_fields_=[("Size",COORD),("CursorPosition",COORD),("Attributes",c_short),("Window",SMALL_RECT),("MaximumWindowSize",COORD)]
|
16
|
+
class CONSOLE_CURSOR_INFO(Structure):
|
17
|
+
_fields_=[('dwSize',c_ulong),('bVisible',c_int)]
|
18
|
+
sbinfo=CONSOLE_SCREEN_BUFFER_INFO()
|
19
|
+
csinfo=CONSOLE_CURSOR_INFO()
|
20
|
+
hconsole=windll.kernel32.GetStdHandle(-11)
|
21
|
+
windll.kernel32.GetConsoleScreenBufferInfo(hconsole,byref(sbinfo))
|
22
|
+
if sbinfo.Size.X<9 or sbinfo.Size.Y<9:raise ValueError('small console')
|
23
|
+
windll.kernel32.GetConsoleCursorInfo(hconsole,byref(csinfo))
|
24
|
+
except Exception:
|
25
|
+
pass
|
26
|
+
else:
|
27
|
+
import re,threading
|
28
|
+
try:
|
29
|
+
_type=unicode
|
30
|
+
except:
|
31
|
+
_type=str
|
32
|
+
to_int=lambda number,default:number and int(number)or default
|
33
|
+
wlock=threading.Lock()
|
34
|
+
STD_OUTPUT_HANDLE=-11
|
35
|
+
STD_ERROR_HANDLE=-12
|
36
|
+
class AnsiTerm(object):
|
37
|
+
def __init__(self):
|
38
|
+
self.encoding=sys.stdout.encoding
|
39
|
+
self.hconsole=windll.kernel32.GetStdHandle(STD_OUTPUT_HANDLE)
|
40
|
+
self.cursor_history=[]
|
41
|
+
self.orig_sbinfo=CONSOLE_SCREEN_BUFFER_INFO()
|
42
|
+
self.orig_csinfo=CONSOLE_CURSOR_INFO()
|
43
|
+
windll.kernel32.GetConsoleScreenBufferInfo(self.hconsole,byref(self.orig_sbinfo))
|
44
|
+
windll.kernel32.GetConsoleCursorInfo(hconsole,byref(self.orig_csinfo))
|
45
|
+
def screen_buffer_info(self):
|
46
|
+
sbinfo=CONSOLE_SCREEN_BUFFER_INFO()
|
47
|
+
windll.kernel32.GetConsoleScreenBufferInfo(self.hconsole,byref(sbinfo))
|
48
|
+
return sbinfo
|
49
|
+
def clear_line(self,param):
|
50
|
+
mode=param and int(param)or 0
|
51
|
+
sbinfo=self.screen_buffer_info()
|
52
|
+
if mode==1:
|
53
|
+
line_start=COORD(0,sbinfo.CursorPosition.Y)
|
54
|
+
line_length=sbinfo.Size.X
|
55
|
+
elif mode==2:
|
56
|
+
line_start=COORD(sbinfo.CursorPosition.X,sbinfo.CursorPosition.Y)
|
57
|
+
line_length=sbinfo.Size.X-sbinfo.CursorPosition.X
|
58
|
+
else:
|
59
|
+
line_start=sbinfo.CursorPosition
|
60
|
+
line_length=sbinfo.Size.X-sbinfo.CursorPosition.X
|
61
|
+
chars_written=c_int()
|
62
|
+
windll.kernel32.FillConsoleOutputCharacterA(self.hconsole,c_wchar(' '),line_length,line_start,byref(chars_written))
|
63
|
+
windll.kernel32.FillConsoleOutputAttribute(self.hconsole,sbinfo.Attributes,line_length,line_start,byref(chars_written))
|
64
|
+
def clear_screen(self,param):
|
65
|
+
mode=to_int(param,0)
|
66
|
+
sbinfo=self.screen_buffer_info()
|
67
|
+
if mode==1:
|
68
|
+
clear_start=COORD(0,0)
|
69
|
+
clear_length=sbinfo.CursorPosition.X*sbinfo.CursorPosition.Y
|
70
|
+
elif mode==2:
|
71
|
+
clear_start=COORD(0,0)
|
72
|
+
clear_length=sbinfo.Size.X*sbinfo.Size.Y
|
73
|
+
windll.kernel32.SetConsoleCursorPosition(self.hconsole,clear_start)
|
74
|
+
else:
|
75
|
+
clear_start=sbinfo.CursorPosition
|
76
|
+
clear_length=((sbinfo.Size.X-sbinfo.CursorPosition.X)+sbinfo.Size.X*(sbinfo.Size.Y-sbinfo.CursorPosition.Y))
|
77
|
+
chars_written=c_int()
|
78
|
+
windll.kernel32.FillConsoleOutputCharacterA(self.hconsole,c_wchar(' '),clear_length,clear_start,byref(chars_written))
|
79
|
+
windll.kernel32.FillConsoleOutputAttribute(self.hconsole,sbinfo.Attributes,clear_length,clear_start,byref(chars_written))
|
80
|
+
def push_cursor(self,param):
|
81
|
+
sbinfo=self.screen_buffer_info()
|
82
|
+
self.cursor_history.append(sbinfo.CursorPosition)
|
83
|
+
def pop_cursor(self,param):
|
84
|
+
if self.cursor_history:
|
85
|
+
old_pos=self.cursor_history.pop()
|
86
|
+
windll.kernel32.SetConsoleCursorPosition(self.hconsole,old_pos)
|
87
|
+
def set_cursor(self,param):
|
88
|
+
y,sep,x=param.partition(';')
|
89
|
+
x=to_int(x,1)-1
|
90
|
+
y=to_int(y,1)-1
|
91
|
+
sbinfo=self.screen_buffer_info()
|
92
|
+
new_pos=COORD(min(max(0,x),sbinfo.Size.X),min(max(0,y),sbinfo.Size.Y))
|
93
|
+
windll.kernel32.SetConsoleCursorPosition(self.hconsole,new_pos)
|
94
|
+
def set_column(self,param):
|
95
|
+
x=to_int(param,1)-1
|
96
|
+
sbinfo=self.screen_buffer_info()
|
97
|
+
new_pos=COORD(min(max(0,x),sbinfo.Size.X),sbinfo.CursorPosition.Y)
|
98
|
+
windll.kernel32.SetConsoleCursorPosition(self.hconsole,new_pos)
|
99
|
+
def move_cursor(self,x_offset=0,y_offset=0):
|
100
|
+
sbinfo=self.screen_buffer_info()
|
101
|
+
new_pos=COORD(min(max(0,sbinfo.CursorPosition.X+x_offset),sbinfo.Size.X),min(max(0,sbinfo.CursorPosition.Y+y_offset),sbinfo.Size.Y))
|
102
|
+
windll.kernel32.SetConsoleCursorPosition(self.hconsole,new_pos)
|
103
|
+
def move_up(self,param):
|
104
|
+
self.move_cursor(y_offset=-to_int(param,1))
|
105
|
+
def move_down(self,param):
|
106
|
+
self.move_cursor(y_offset=to_int(param,1))
|
107
|
+
def move_left(self,param):
|
108
|
+
self.move_cursor(x_offset=-to_int(param,1))
|
109
|
+
def move_right(self,param):
|
110
|
+
self.move_cursor(x_offset=to_int(param,1))
|
111
|
+
def next_line(self,param):
|
112
|
+
sbinfo=self.screen_buffer_info()
|
113
|
+
self.move_cursor(x_offset=-sbinfo.CursorPosition.X,y_offset=to_int(param,1))
|
114
|
+
def prev_line(self,param):
|
115
|
+
sbinfo=self.screen_buffer_info()
|
116
|
+
self.move_cursor(x_offset=-sbinfo.CursorPosition.X,y_offset=-to_int(param,1))
|
117
|
+
def rgb2bgr(self,c):
|
118
|
+
return((c&1)<<2)|(c&2)|((c&4)>>2)
|
119
|
+
def set_color(self,param):
|
120
|
+
cols=param.split(';')
|
121
|
+
sbinfo=CONSOLE_SCREEN_BUFFER_INFO()
|
122
|
+
windll.kernel32.GetConsoleScreenBufferInfo(self.hconsole,byref(sbinfo))
|
123
|
+
attr=sbinfo.Attributes
|
124
|
+
for c in cols:
|
125
|
+
c=to_int(c,0)
|
126
|
+
if c in range(30,38):
|
127
|
+
attr=(attr&0xfff0)|self.rgb2bgr(c-30)
|
128
|
+
elif c in range(40,48):
|
129
|
+
attr=(attr&0xff0f)|(self.rgb2bgr(c-40)<<4)
|
130
|
+
elif c==0:
|
131
|
+
attr=self.orig_sbinfo.Attributes
|
132
|
+
elif c==1:
|
133
|
+
attr|=0x08
|
134
|
+
elif c==4:
|
135
|
+
attr|=0x80
|
136
|
+
elif c==7:
|
137
|
+
attr=(attr&0xff88)|((attr&0x70)>>4)|((attr&0x07)<<4)
|
138
|
+
windll.kernel32.SetConsoleTextAttribute(self.hconsole,attr)
|
139
|
+
def show_cursor(self,param):
|
140
|
+
csinfo.bVisible=1
|
141
|
+
windll.kernel32.SetConsoleCursorInfo(self.hconsole,byref(csinfo))
|
142
|
+
def hide_cursor(self,param):
|
143
|
+
csinfo.bVisible=0
|
144
|
+
windll.kernel32.SetConsoleCursorInfo(self.hconsole,byref(csinfo))
|
145
|
+
ansi_command_table={'A':move_up,'B':move_down,'C':move_right,'D':move_left,'E':next_line,'F':prev_line,'G':set_column,'H':set_cursor,'f':set_cursor,'J':clear_screen,'K':clear_line,'h':show_cursor,'l':hide_cursor,'m':set_color,'s':push_cursor,'u':pop_cursor,}
|
146
|
+
ansi_tokens=re.compile('(?:\x1b\[([0-9?;]*)([a-zA-Z])|([^\x1b]+))')
|
147
|
+
def write(self,text):
|
148
|
+
try:
|
149
|
+
wlock.acquire()
|
150
|
+
for param,cmd,txt in self.ansi_tokens.findall(text):
|
151
|
+
if cmd:
|
152
|
+
cmd_func=self.ansi_command_table.get(cmd)
|
153
|
+
if cmd_func:
|
154
|
+
cmd_func(self,param)
|
155
|
+
else:
|
156
|
+
self.writeconsole(txt)
|
157
|
+
finally:
|
158
|
+
wlock.release()
|
159
|
+
def writeconsole(self,txt):
|
160
|
+
chars_written=c_int()
|
161
|
+
writeconsole=windll.kernel32.WriteConsoleA
|
162
|
+
if isinstance(txt,_type):
|
163
|
+
writeconsole=windll.kernel32.WriteConsoleW
|
164
|
+
TINY_STEP=3000
|
165
|
+
for x in range(0,len(txt),TINY_STEP):
|
166
|
+
tiny=txt[x:x+TINY_STEP]
|
167
|
+
writeconsole(self.hconsole,tiny,len(tiny),byref(chars_written),None)
|
168
|
+
def flush(self):
|
169
|
+
pass
|
170
|
+
def isatty(self):
|
171
|
+
return True
|
172
|
+
sys.stderr=sys.stdout=AnsiTerm()
|
173
|
+
os.environ['TERM']='vt100'
|
Binary file
|
data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/extras/__init__.pyc
ADDED
Binary file
|
data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/extras/compat15.py
ADDED
@@ -0,0 +1,223 @@
|
|
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 sys
|
6
|
+
if sys.hexversion < 0x020400f0: from sets import Set as set
|
7
|
+
import sys
|
8
|
+
from waflib import ConfigSet,Logs,Options,Scripting,Task,Build,Configure,Node,Runner,TaskGen,Utils,Errors,Context
|
9
|
+
sys.modules['Environment']=ConfigSet
|
10
|
+
ConfigSet.Environment=ConfigSet.ConfigSet
|
11
|
+
sys.modules['Logs']=Logs
|
12
|
+
sys.modules['Options']=Options
|
13
|
+
sys.modules['Scripting']=Scripting
|
14
|
+
sys.modules['Task']=Task
|
15
|
+
sys.modules['Build']=Build
|
16
|
+
sys.modules['Configure']=Configure
|
17
|
+
sys.modules['Node']=Node
|
18
|
+
sys.modules['Runner']=Runner
|
19
|
+
sys.modules['TaskGen']=TaskGen
|
20
|
+
sys.modules['Utils']=Utils
|
21
|
+
from waflib.Tools import c_preproc
|
22
|
+
sys.modules['preproc']=c_preproc
|
23
|
+
from waflib.Tools import c_config
|
24
|
+
sys.modules['config_c']=c_config
|
25
|
+
ConfigSet.ConfigSet.copy=ConfigSet.ConfigSet.derive
|
26
|
+
ConfigSet.ConfigSet.set_variant=Utils.nada
|
27
|
+
Build.BuildContext.add_subdirs=Build.BuildContext.recurse
|
28
|
+
Build.BuildContext.new_task_gen=Build.BuildContext.__call__
|
29
|
+
Build.BuildContext.is_install=0
|
30
|
+
Node.Node.relpath_gen=Node.Node.path_from
|
31
|
+
def name_to_obj(self,s,env=None):
|
32
|
+
Logs.warn('compat: change "name_to_obj(name, env)" by "get_tgen_by_name(name)"')
|
33
|
+
return self.get_tgen_by_name(s)
|
34
|
+
Build.BuildContext.name_to_obj=name_to_obj
|
35
|
+
def env_of_name(self,name):
|
36
|
+
try:
|
37
|
+
return self.all_envs[name]
|
38
|
+
except KeyError:
|
39
|
+
Logs.error('no such environment: '+name)
|
40
|
+
return None
|
41
|
+
Build.BuildContext.env_of_name=env_of_name
|
42
|
+
def set_env_name(self,name,env):
|
43
|
+
self.all_envs[name]=env
|
44
|
+
return env
|
45
|
+
Configure.ConfigurationContext.set_env_name=set_env_name
|
46
|
+
def retrieve(self,name,fromenv=None):
|
47
|
+
try:
|
48
|
+
env=self.all_envs[name]
|
49
|
+
except KeyError:
|
50
|
+
env=ConfigSet.ConfigSet()
|
51
|
+
self.prepare_env(env)
|
52
|
+
self.all_envs[name]=env
|
53
|
+
else:
|
54
|
+
if fromenv:Logs.warn("The environment %s may have been configured already"%name)
|
55
|
+
return env
|
56
|
+
Configure.ConfigurationContext.retrieve=retrieve
|
57
|
+
Configure.ConfigurationContext.sub_config=Configure.ConfigurationContext.recurse
|
58
|
+
Configure.ConfigurationContext.check_tool=Configure.ConfigurationContext.load
|
59
|
+
Configure.conftest=Configure.conf
|
60
|
+
Configure.ConfigurationError=Errors.ConfigurationError
|
61
|
+
Options.OptionsContext.sub_options=Options.OptionsContext.recurse
|
62
|
+
Options.OptionsContext.tool_options=Context.Context.load
|
63
|
+
Options.Handler=Options.OptionsContext
|
64
|
+
Task.simple_task_type=Task.task_type_from_func=Task.task_factory
|
65
|
+
Task.TaskBase.classes=Task.classes
|
66
|
+
def setitem(self,key,value):
|
67
|
+
if key.startswith('CCFLAGS'):
|
68
|
+
key=key[1:]
|
69
|
+
self.table[key]=value
|
70
|
+
ConfigSet.ConfigSet.__setitem__=setitem
|
71
|
+
def old_importpaths(self):
|
72
|
+
if getattr(self,'importpaths',[]):
|
73
|
+
self.includes=self.importpaths
|
74
|
+
from waflib import Context
|
75
|
+
eld=Context.load_tool
|
76
|
+
def load_tool(*k,**kw):
|
77
|
+
ret=eld(*k,**kw)
|
78
|
+
if'set_options'in ret.__dict__:
|
79
|
+
Logs.warn('compat: rename "set_options" to options')
|
80
|
+
ret.options=ret.set_options
|
81
|
+
if'detect'in ret.__dict__:
|
82
|
+
Logs.warn('compat: rename "detect" to "configure"')
|
83
|
+
ret.configure=ret.detect
|
84
|
+
return ret
|
85
|
+
Context.load_tool=load_tool
|
86
|
+
rev=Context.load_module
|
87
|
+
def load_module(path):
|
88
|
+
ret=rev(path)
|
89
|
+
if'set_options'in ret.__dict__:
|
90
|
+
Logs.warn('compat: rename "set_options" to "options" (%r)'%path)
|
91
|
+
ret.options=ret.set_options
|
92
|
+
if'srcdir'in ret.__dict__:
|
93
|
+
Logs.warn('compat: rename "srcdir" to "top" (%r)'%path)
|
94
|
+
ret.top=ret.srcdir
|
95
|
+
if'blddir'in ret.__dict__:
|
96
|
+
Logs.warn('compat: rename "blddir" to "out" (%r)'%path)
|
97
|
+
ret.out=ret.blddir
|
98
|
+
return ret
|
99
|
+
Context.load_module=load_module
|
100
|
+
old_post=TaskGen.task_gen.post
|
101
|
+
def post(self):
|
102
|
+
self.features=self.to_list(self.features)
|
103
|
+
if'cc'in self.features:
|
104
|
+
Logs.warn('compat: the feature cc does not exist anymore (use "c")')
|
105
|
+
self.features.remove('cc')
|
106
|
+
self.features.append('c')
|
107
|
+
if'cstaticlib'in self.features:
|
108
|
+
Logs.warn('compat: the feature cstaticlib does not exist anymore (use "cstlib" or "cxxstlib")')
|
109
|
+
self.features.remove('cstaticlib')
|
110
|
+
self.features.append(('cxx'in self.features)and'cxxstlib'or'cstlib')
|
111
|
+
if getattr(self,'ccflags',None):
|
112
|
+
Logs.warn('compat: "ccflags" was renamed to "cflags"')
|
113
|
+
self.cflags=self.ccflags
|
114
|
+
return old_post(self)
|
115
|
+
TaskGen.task_gen.post=post
|
116
|
+
def waf_version(*k,**kw):
|
117
|
+
Logs.warn('wrong version (waf_version was removed in waf 1.6)')
|
118
|
+
Utils.waf_version=waf_version
|
119
|
+
import os
|
120
|
+
def apply_uselib_local(self):
|
121
|
+
env=self.env
|
122
|
+
from waflib.Tools.ccroot import stlink_task
|
123
|
+
self.uselib=self.to_list(getattr(self,'uselib',[]))
|
124
|
+
self.includes=self.to_list(getattr(self,'includes',[]))
|
125
|
+
names=self.to_list(getattr(self,'uselib_local',[]))
|
126
|
+
get=self.bld.get_tgen_by_name
|
127
|
+
seen=set([])
|
128
|
+
tmp=Utils.deque(names)
|
129
|
+
if tmp:
|
130
|
+
Logs.warn('compat: "uselib_local" is deprecated, replace by "use"')
|
131
|
+
while tmp:
|
132
|
+
lib_name=tmp.popleft()
|
133
|
+
if lib_name in seen:
|
134
|
+
continue
|
135
|
+
y=get(lib_name)
|
136
|
+
y.post()
|
137
|
+
seen.add(lib_name)
|
138
|
+
if getattr(y,'uselib_local',None):
|
139
|
+
for x in self.to_list(getattr(y,'uselib_local',[])):
|
140
|
+
obj=get(x)
|
141
|
+
obj.post()
|
142
|
+
if getattr(obj,'link_task',None):
|
143
|
+
if not isinstance(obj.link_task,stlink_task):
|
144
|
+
tmp.append(x)
|
145
|
+
if getattr(y,'link_task',None):
|
146
|
+
link_name=y.target[y.target.rfind(os.sep)+1:]
|
147
|
+
if isinstance(y.link_task,stlink_task):
|
148
|
+
env.append_value('STLIB',[link_name])
|
149
|
+
else:
|
150
|
+
env.append_value('LIB',[link_name])
|
151
|
+
self.link_task.set_run_after(y.link_task)
|
152
|
+
self.link_task.dep_nodes+=y.link_task.outputs
|
153
|
+
tmp_path=y.link_task.outputs[0].parent.bldpath()
|
154
|
+
if not tmp_path in env['LIBPATH']:
|
155
|
+
env.prepend_value('LIBPATH',[tmp_path])
|
156
|
+
for v in self.to_list(getattr(y,'uselib',[])):
|
157
|
+
if not env['STLIB_'+v]:
|
158
|
+
if not v in self.uselib:
|
159
|
+
self.uselib.insert(0,v)
|
160
|
+
if getattr(y,'export_includes',None):
|
161
|
+
self.includes.extend(y.to_incnodes(y.export_includes))
|
162
|
+
def apply_objdeps(self):
|
163
|
+
names=getattr(self,'add_objects',[])
|
164
|
+
if not names:
|
165
|
+
return
|
166
|
+
names=self.to_list(names)
|
167
|
+
get=self.bld.get_tgen_by_name
|
168
|
+
seen=[]
|
169
|
+
while names:
|
170
|
+
x=names[0]
|
171
|
+
if x in seen:
|
172
|
+
names=names[1:]
|
173
|
+
continue
|
174
|
+
y=get(x)
|
175
|
+
if getattr(y,'add_objects',None):
|
176
|
+
added=0
|
177
|
+
lst=y.to_list(y.add_objects)
|
178
|
+
lst.reverse()
|
179
|
+
for u in lst:
|
180
|
+
if u in seen:continue
|
181
|
+
added=1
|
182
|
+
names=[u]+names
|
183
|
+
if added:continue
|
184
|
+
y.post()
|
185
|
+
seen.append(x)
|
186
|
+
for t in getattr(y,'compiled_tasks',[]):
|
187
|
+
self.link_task.inputs.extend(t.outputs)
|
188
|
+
def process_obj_files(self):
|
189
|
+
if not hasattr(self,'obj_files'):
|
190
|
+
return
|
191
|
+
for x in self.obj_files:
|
192
|
+
node=self.path.find_resource(x)
|
193
|
+
self.link_task.inputs.append(node)
|
194
|
+
def add_obj_file(self,file):
|
195
|
+
if not hasattr(self,'obj_files'):self.obj_files=[]
|
196
|
+
if not'process_obj_files'in self.meths:self.meths.append('process_obj_files')
|
197
|
+
self.obj_files.append(file)
|
198
|
+
old_define=Configure.ConfigurationContext.__dict__['define']
|
199
|
+
def define(self,key,val,quote=True):
|
200
|
+
old_define(self,key,val,quote)
|
201
|
+
if key.startswith('HAVE_'):
|
202
|
+
self.env[key]=1
|
203
|
+
old_undefine=Configure.ConfigurationContext.__dict__['undefine']
|
204
|
+
def undefine(self,key):
|
205
|
+
old_undefine(self,key)
|
206
|
+
if key.startswith('HAVE_'):
|
207
|
+
self.env[key]=0
|
208
|
+
def set_incdirs(self,val):
|
209
|
+
Logs.warn('compat: change "export_incdirs" by "export_includes"')
|
210
|
+
self.export_includes=val
|
211
|
+
TaskGen.task_gen.export_incdirs=property(None,set_incdirs)
|
212
|
+
|
213
|
+
TaskGen.feature('d')(old_importpaths)
|
214
|
+
TaskGen.before('apply_incpaths')(old_importpaths)
|
215
|
+
TaskGen.feature('c','cxx','d')(apply_uselib_local)
|
216
|
+
TaskGen.before('apply_incpaths','propagate_uselib_vars')(apply_uselib_local)
|
217
|
+
TaskGen.after('apply_link','process_source')(apply_uselib_local)
|
218
|
+
TaskGen.feature('cprogram','cxxprogram','cstlib','cxxstlib','cshlib','cxxshlib','dprogram','dstlib','dshlib')(apply_objdeps)
|
219
|
+
TaskGen.after('apply_link')(apply_objdeps)
|
220
|
+
TaskGen.after('apply_link')(process_obj_files)
|
221
|
+
TaskGen.taskgen_method(add_obj_file)
|
222
|
+
Configure.conf(define)
|
223
|
+
Configure.conf(undefine)
|
data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/extras/compat15.pyc
ADDED
Binary file
|
@@ -0,0 +1,50 @@
|
|
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
|
6
|
+
all_modifs={}
|
7
|
+
def fixdir(dir):
|
8
|
+
global all_modifs
|
9
|
+
for k in all_modifs:
|
10
|
+
for v in all_modifs[k]:
|
11
|
+
modif(os.path.join(dir,'waflib'),k,v)
|
12
|
+
def modif(dir,name,fun):
|
13
|
+
if name=='*':
|
14
|
+
lst=[]
|
15
|
+
for y in'. Tools extras'.split():
|
16
|
+
for x in os.listdir(os.path.join(dir,y)):
|
17
|
+
if x.endswith('.py'):
|
18
|
+
lst.append(y+os.sep+x)
|
19
|
+
for x in lst:
|
20
|
+
modif(dir,x,fun)
|
21
|
+
return
|
22
|
+
filename=os.path.join(dir,name)
|
23
|
+
f=open(filename,'r')
|
24
|
+
txt=f.read()
|
25
|
+
f.close()
|
26
|
+
txt=fun(txt)
|
27
|
+
f=open(filename,'w')
|
28
|
+
f.write(txt)
|
29
|
+
f.close()
|
30
|
+
def subst(*k):
|
31
|
+
def do_subst(fun):
|
32
|
+
global all_modifs
|
33
|
+
for x in k:
|
34
|
+
try:
|
35
|
+
all_modifs[x].append(fun)
|
36
|
+
except KeyError:
|
37
|
+
all_modifs[x]=[fun]
|
38
|
+
return fun
|
39
|
+
return do_subst
|
40
|
+
def r1(code):
|
41
|
+
code=code.replace(',e:',',e:')
|
42
|
+
code=code.replace("",'')
|
43
|
+
code=code.replace('','')
|
44
|
+
return code
|
45
|
+
def r4(code):
|
46
|
+
code=code.replace('next(self.biter)','self.biter.next()')
|
47
|
+
return code
|
48
|
+
|
49
|
+
subst('*')(r1)
|
50
|
+
subst('Runner.py')(r4)
|