qrscanner 0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (480) hide show
  1. data/CHANGELOG +2 -0
  2. data/Manifest +478 -0
  3. data/README +41 -0
  4. data/Rakefile +9 -0
  5. data/bin/qrscanner +9 -0
  6. data/ext/qrscanner/extconf.rb +70 -0
  7. data/ext/qrscanner/qrscanner.c +32 -0
  8. data/ext/qrscanner/zxing/README +43 -0
  9. data/ext/qrscanner/zxing/SConscript +55 -0
  10. data/ext/qrscanner/zxing/SConstruct +7 -0
  11. data/ext/qrscanner/zxing/astyle-options +12 -0
  12. data/ext/qrscanner/zxing/blackboxtest.sh +45 -0
  13. data/ext/qrscanner/zxing/core/src/zxing/BarcodeFormat.cpp +38 -0
  14. data/ext/qrscanner/zxing/core/src/zxing/BarcodeFormat.h +42 -0
  15. data/ext/qrscanner/zxing/core/src/zxing/Binarizer.cpp +36 -0
  16. data/ext/qrscanner/zxing/core/src/zxing/Binarizer.h +46 -0
  17. data/ext/qrscanner/zxing/core/src/zxing/BinaryBitmap.cpp +67 -0
  18. data/ext/qrscanner/zxing/core/src/zxing/BinaryBitmap.h +57 -0
  19. data/ext/qrscanner/zxing/core/src/zxing/DecodeHints.cpp +111 -0
  20. data/ext/qrscanner/zxing/core/src/zxing/DecodeHints.h +69 -0
  21. data/ext/qrscanner/zxing/core/src/zxing/Exception.cpp +25 -0
  22. data/ext/qrscanner/zxing/core/src/zxing/Exception.h +39 -0
  23. data/ext/qrscanner/zxing/core/src/zxing/LuminanceSource.cpp +47 -0
  24. data/ext/qrscanner/zxing/core/src/zxing/LuminanceSource.h +49 -0
  25. data/ext/qrscanner/zxing/core/src/zxing/MultiFormatReader.cpp +102 -0
  26. data/ext/qrscanner/zxing/core/src/zxing/MultiFormatReader.h +49 -0
  27. data/ext/qrscanner/zxing/core/src/zxing/Reader.cpp +31 -0
  28. data/ext/qrscanner/zxing/core/src/zxing/Reader.h +40 -0
  29. data/ext/qrscanner/zxing/core/src/zxing/ReaderException.cpp +32 -0
  30. data/ext/qrscanner/zxing/core/src/zxing/ReaderException.h +34 -0
  31. data/ext/qrscanner/zxing/core/src/zxing/Result.cpp +59 -0
  32. data/ext/qrscanner/zxing/core/src/zxing/Result.h +53 -0
  33. data/ext/qrscanner/zxing/core/src/zxing/ResultPoint.cpp +27 -0
  34. data/ext/qrscanner/zxing/core/src/zxing/ResultPoint.h +39 -0
  35. data/ext/qrscanner/zxing/core/src/zxing/ResultPointCallback.cpp +26 -0
  36. data/ext/qrscanner/zxing/core/src/zxing/ResultPointCallback.h +39 -0
  37. data/ext/qrscanner/zxing/core/src/zxing/common/Array.cpp +22 -0
  38. data/ext/qrscanner/zxing/core/src/zxing/common/Array.h +207 -0
  39. data/ext/qrscanner/zxing/core/src/zxing/common/BitArray.cpp +129 -0
  40. data/ext/qrscanner/zxing/core/src/zxing/common/BitArray.h +55 -0
  41. data/ext/qrscanner/zxing/core/src/zxing/common/BitMatrix.cpp +178 -0
  42. data/ext/qrscanner/zxing/core/src/zxing/common/BitMatrix.h +65 -0
  43. data/ext/qrscanner/zxing/core/src/zxing/common/BitSource.cpp +75 -0
  44. data/ext/qrscanner/zxing/core/src/zxing/common/BitSource.h +67 -0
  45. data/ext/qrscanner/zxing/core/src/zxing/common/Counted.cpp +32 -0
  46. data/ext/qrscanner/zxing/core/src/zxing/common/Counted.h +205 -0
  47. data/ext/qrscanner/zxing/core/src/zxing/common/DecoderResult.cpp +37 -0
  48. data/ext/qrscanner/zxing/core/src/zxing/common/DecoderResult.h +43 -0
  49. data/ext/qrscanner/zxing/core/src/zxing/common/DetectorResult.cpp +41 -0
  50. data/ext/qrscanner/zxing/core/src/zxing/common/DetectorResult.h +46 -0
  51. data/ext/qrscanner/zxing/core/src/zxing/common/EdgeDetector.cpp +191 -0
  52. data/ext/qrscanner/zxing/core/src/zxing/common/EdgeDetector.h +38 -0
  53. data/ext/qrscanner/zxing/core/src/zxing/common/GlobalHistogramBinarizer.cpp +209 -0
  54. data/ext/qrscanner/zxing/core/src/zxing/common/GlobalHistogramBinarizer.h +47 -0
  55. data/ext/qrscanner/zxing/core/src/zxing/common/GreyscaleLuminanceSource.cpp +70 -0
  56. data/ext/qrscanner/zxing/core/src/zxing/common/GreyscaleLuminanceSource.h +62 -0
  57. data/ext/qrscanner/zxing/core/src/zxing/common/GreyscaleRotatedLuminanceSource.cpp +65 -0
  58. data/ext/qrscanner/zxing/core/src/zxing/common/GreyscaleRotatedLuminanceSource.h +60 -0
  59. data/ext/qrscanner/zxing/core/src/zxing/common/GridSampler.cpp +101 -0
  60. data/ext/qrscanner/zxing/core/src/zxing/common/GridSampler.h +43 -0
  61. data/ext/qrscanner/zxing/core/src/zxing/common/HybridBinarizer.cpp +168 -0
  62. data/ext/qrscanner/zxing/core/src/zxing/common/HybridBinarizer.h +55 -0
  63. data/ext/qrscanner/zxing/core/src/zxing/common/IllegalArgumentException.cpp +31 -0
  64. data/ext/qrscanner/zxing/core/src/zxing/common/IllegalArgumentException.h +33 -0
  65. data/ext/qrscanner/zxing/core/src/zxing/common/PerspectiveTransform.cpp +107 -0
  66. data/ext/qrscanner/zxing/core/src/zxing/common/PerspectiveTransform.h +49 -0
  67. data/ext/qrscanner/zxing/core/src/zxing/common/Point.h +47 -0
  68. data/ext/qrscanner/zxing/core/src/zxing/common/Str.cpp +38 -0
  69. data/ext/qrscanner/zxing/core/src/zxing/common/Str.h +40 -0
  70. data/ext/qrscanner/zxing/core/src/zxing/common/reedsolomon/GF256.cpp +136 -0
  71. data/ext/qrscanner/zxing/core/src/zxing/common/reedsolomon/GF256.h +68 -0
  72. data/ext/qrscanner/zxing/core/src/zxing/common/reedsolomon/GF256Poly.cpp +198 -0
  73. data/ext/qrscanner/zxing/core/src/zxing/common/reedsolomon/GF256Poly.h +53 -0
  74. data/ext/qrscanner/zxing/core/src/zxing/common/reedsolomon/ReedSolomonDecoder.cpp +193 -0
  75. data/ext/qrscanner/zxing/core/src/zxing/common/reedsolomon/ReedSolomonDecoder.h +46 -0
  76. data/ext/qrscanner/zxing/core/src/zxing/common/reedsolomon/ReedSolomonException.cpp +30 -0
  77. data/ext/qrscanner/zxing/core/src/zxing/common/reedsolomon/ReedSolomonException.h +33 -0
  78. data/ext/qrscanner/zxing/core/src/zxing/datamatrix/DataMatrixReader.cpp +82 -0
  79. data/ext/qrscanner/zxing/core/src/zxing/datamatrix/DataMatrixReader.h +45 -0
  80. data/ext/qrscanner/zxing/core/src/zxing/datamatrix/Version.cpp +199 -0
  81. data/ext/qrscanner/zxing/core/src/zxing/datamatrix/Version.h +87 -0
  82. data/ext/qrscanner/zxing/core/src/zxing/datamatrix/decoder/BitMatrixParser.cpp +364 -0
  83. data/ext/qrscanner/zxing/core/src/zxing/datamatrix/decoder/BitMatrixParser.h +59 -0
  84. data/ext/qrscanner/zxing/core/src/zxing/datamatrix/decoder/DataBlock.cpp +113 -0
  85. data/ext/qrscanner/zxing/core/src/zxing/datamatrix/decoder/DataBlock.h +49 -0
  86. data/ext/qrscanner/zxing/core/src/zxing/datamatrix/decoder/DecodedBitStreamParser.cpp +404 -0
  87. data/ext/qrscanner/zxing/core/src/zxing/datamatrix/decoder/DecodedBitStreamParser.h +103 -0
  88. data/ext/qrscanner/zxing/core/src/zxing/datamatrix/decoder/Decoder.cpp +96 -0
  89. data/ext/qrscanner/zxing/core/src/zxing/datamatrix/decoder/Decoder.h +50 -0
  90. data/ext/qrscanner/zxing/core/src/zxing/datamatrix/detector/CornerPoint.cpp +54 -0
  91. data/ext/qrscanner/zxing/core/src/zxing/datamatrix/detector/CornerPoint.h +47 -0
  92. data/ext/qrscanner/zxing/core/src/zxing/datamatrix/detector/Detector.cpp +315 -0
  93. data/ext/qrscanner/zxing/core/src/zxing/datamatrix/detector/Detector.h +79 -0
  94. data/ext/qrscanner/zxing/core/src/zxing/datamatrix/detector/MonochromeRectangleDetector.cpp +172 -0
  95. data/ext/qrscanner/zxing/core/src/zxing/datamatrix/detector/MonochromeRectangleDetector.h +61 -0
  96. data/ext/qrscanner/zxing/core/src/zxing/oned/Code128Reader.cpp +490 -0
  97. data/ext/qrscanner/zxing/core/src/zxing/oned/Code128Reader.h +63 -0
  98. data/ext/qrscanner/zxing/core/src/zxing/oned/Code39Reader.cpp +352 -0
  99. data/ext/qrscanner/zxing/core/src/zxing/oned/Code39Reader.h +58 -0
  100. data/ext/qrscanner/zxing/core/src/zxing/oned/EAN13Reader.cpp +95 -0
  101. data/ext/qrscanner/zxing/core/src/zxing/oned/EAN13Reader.h +44 -0
  102. data/ext/qrscanner/zxing/core/src/zxing/oned/EAN8Reader.cpp +73 -0
  103. data/ext/qrscanner/zxing/core/src/zxing/oned/EAN8Reader.h +41 -0
  104. data/ext/qrscanner/zxing/core/src/zxing/oned/ITFReader.cpp +363 -0
  105. data/ext/qrscanner/zxing/core/src/zxing/oned/ITFReader.h +56 -0
  106. data/ext/qrscanner/zxing/core/src/zxing/oned/MultiFormatOneDReader.cpp +66 -0
  107. data/ext/qrscanner/zxing/core/src/zxing/oned/MultiFormatOneDReader.h +38 -0
  108. data/ext/qrscanner/zxing/core/src/zxing/oned/MultiFormatUPCEANReader.cpp +87 -0
  109. data/ext/qrscanner/zxing/core/src/zxing/oned/MultiFormatUPCEANReader.h +38 -0
  110. data/ext/qrscanner/zxing/core/src/zxing/oned/OneDReader.cpp +206 -0
  111. data/ext/qrscanner/zxing/core/src/zxing/oned/OneDReader.h +50 -0
  112. data/ext/qrscanner/zxing/core/src/zxing/oned/OneDResultPoint.cpp +36 -0
  113. data/ext/qrscanner/zxing/core/src/zxing/oned/OneDResultPoint.h +40 -0
  114. data/ext/qrscanner/zxing/core/src/zxing/oned/UPCAReader.cpp +65 -0
  115. data/ext/qrscanner/zxing/core/src/zxing/oned/UPCAReader.h +49 -0
  116. data/ext/qrscanner/zxing/core/src/zxing/oned/UPCEANReader.cpp +311 -0
  117. data/ext/qrscanner/zxing/core/src/zxing/oned/UPCEANReader.h +77 -0
  118. data/ext/qrscanner/zxing/core/src/zxing/oned/UPCEReader.cpp +143 -0
  119. data/ext/qrscanner/zxing/core/src/zxing/oned/UPCEReader.h +47 -0
  120. data/ext/qrscanner/zxing/core/src/zxing/qrcode/ErrorCorrectionLevel.cpp +49 -0
  121. data/ext/qrscanner/zxing/core/src/zxing/qrcode/ErrorCorrectionLevel.h +46 -0
  122. data/ext/qrscanner/zxing/core/src/zxing/qrcode/FormatInformation.cpp +108 -0
  123. data/ext/qrscanner/zxing/core/src/zxing/qrcode/FormatInformation.h +54 -0
  124. data/ext/qrscanner/zxing/core/src/zxing/qrcode/QRCodeReader.cpp +82 -0
  125. data/ext/qrscanner/zxing/core/src/zxing/qrcode/QRCodeReader.h +43 -0
  126. data/ext/qrscanner/zxing/core/src/zxing/qrcode/Version.cpp +557 -0
  127. data/ext/qrscanner/zxing/core/src/zxing/qrcode/Version.h +85 -0
  128. data/ext/qrscanner/zxing/core/src/zxing/qrcode/decoder/BitMatrixParser.cpp +191 -0
  129. data/ext/qrscanner/zxing/core/src/zxing/qrcode/decoder/BitMatrixParser.h +56 -0
  130. data/ext/qrscanner/zxing/core/src/zxing/qrcode/decoder/DataBlock.cpp +118 -0
  131. data/ext/qrscanner/zxing/core/src/zxing/qrcode/decoder/DataBlock.h +50 -0
  132. data/ext/qrscanner/zxing/core/src/zxing/qrcode/decoder/DataMask.cpp +159 -0
  133. data/ext/qrscanner/zxing/core/src/zxing/qrcode/decoder/DataMask.h +50 -0
  134. data/ext/qrscanner/zxing/core/src/zxing/qrcode/decoder/DecodedBitStreamParser.cpp +353 -0
  135. data/ext/qrscanner/zxing/core/src/zxing/qrcode/decoder/DecodedBitStreamParser.h +59 -0
  136. data/ext/qrscanner/zxing/core/src/zxing/qrcode/decoder/Decoder.cpp +103 -0
  137. data/ext/qrscanner/zxing/core/src/zxing/qrcode/decoder/Decoder.h +47 -0
  138. data/ext/qrscanner/zxing/core/src/zxing/qrcode/decoder/Mode.cpp +73 -0
  139. data/ext/qrscanner/zxing/core/src/zxing/qrcode/decoder/Mode.h +50 -0
  140. data/ext/qrscanner/zxing/core/src/zxing/qrcode/detector/AlignmentPattern.cpp +46 -0
  141. data/ext/qrscanner/zxing/core/src/zxing/qrcode/detector/AlignmentPattern.h +45 -0
  142. data/ext/qrscanner/zxing/core/src/zxing/qrcode/detector/AlignmentPatternFinder.cpp +209 -0
  143. data/ext/qrscanner/zxing/core/src/zxing/qrcode/detector/AlignmentPatternFinder.h +68 -0
  144. data/ext/qrscanner/zxing/core/src/zxing/qrcode/detector/Detector.cpp +286 -0
  145. data/ext/qrscanner/zxing/core/src/zxing/qrcode/detector/Detector.h +64 -0
  146. data/ext/qrscanner/zxing/core/src/zxing/qrcode/detector/FinderPattern.cpp +58 -0
  147. data/ext/qrscanner/zxing/core/src/zxing/qrcode/detector/FinderPattern.h +48 -0
  148. data/ext/qrscanner/zxing/core/src/zxing/qrcode/detector/FinderPatternFinder.cpp +540 -0
  149. data/ext/qrscanner/zxing/core/src/zxing/qrcode/detector/FinderPatternFinder.h +69 -0
  150. data/ext/qrscanner/zxing/core/src/zxing/qrcode/detector/FinderPatternInfo.cpp +41 -0
  151. data/ext/qrscanner/zxing/core/src/zxing/qrcode/detector/FinderPatternInfo.h +47 -0
  152. data/ext/qrscanner/zxing/core/src/zxing/qrcode/detector/QREdgeDetector.cpp +169 -0
  153. data/ext/qrscanner/zxing/core/src/zxing/qrcode/detector/QREdgeDetector.h +48 -0
  154. data/ext/qrscanner/zxing/core/tests/src/TestRunner.cpp +30 -0
  155. data/ext/qrscanner/zxing/core/tests/src/common/BitArrayTest.cpp +96 -0
  156. data/ext/qrscanner/zxing/core/tests/src/common/BitArrayTest.h +50 -0
  157. data/ext/qrscanner/zxing/core/tests/src/common/BitMatrixTest.cpp +107 -0
  158. data/ext/qrscanner/zxing/core/tests/src/common/BitMatrixTest.h +55 -0
  159. data/ext/qrscanner/zxing/core/tests/src/common/BitSourceTest.cpp +49 -0
  160. data/ext/qrscanner/zxing/core/tests/src/common/BitSourceTest.h +42 -0
  161. data/ext/qrscanner/zxing/core/tests/src/common/BlackPointEstimatorTest.cpp +47 -0
  162. data/ext/qrscanner/zxing/core/tests/src/common/BlackPointEstimatorTest.h +45 -0
  163. data/ext/qrscanner/zxing/core/tests/src/common/CountedTest.cpp +54 -0
  164. data/ext/qrscanner/zxing/core/tests/src/common/CountedTest.h +46 -0
  165. data/ext/qrscanner/zxing/core/tests/src/common/PerspectiveTransformTest.cpp +69 -0
  166. data/ext/qrscanner/zxing/core/tests/src/common/PerspectiveTransformTest.h +47 -0
  167. data/ext/qrscanner/zxing/core/tests/src/common/reedsolomon/ReedSolomonTest.cpp +130 -0
  168. data/ext/qrscanner/zxing/core/tests/src/common/reedsolomon/ReedSolomonTest.h +62 -0
  169. data/ext/qrscanner/zxing/core/tests/src/qrcode/ErrorCorrectionLevelTest.cpp +47 -0
  170. data/ext/qrscanner/zxing/core/tests/src/qrcode/ErrorCorrectionLevelTest.h +45 -0
  171. data/ext/qrscanner/zxing/core/tests/src/qrcode/FormatInformationTest.cpp +70 -0
  172. data/ext/qrscanner/zxing/core/tests/src/qrcode/FormatInformationTest.h +47 -0
  173. data/ext/qrscanner/zxing/core/tests/src/qrcode/VersionTest.cpp +88 -0
  174. data/ext/qrscanner/zxing/core/tests/src/qrcode/VersionTest.h +49 -0
  175. data/ext/qrscanner/zxing/core/tests/src/qrcode/decoder/DataMaskTest.cpp +134 -0
  176. data/ext/qrscanner/zxing/core/tests/src/qrcode/decoder/DataMaskTest.h +91 -0
  177. data/ext/qrscanner/zxing/core/tests/src/qrcode/decoder/ModeTest.cpp +52 -0
  178. data/ext/qrscanner/zxing/core/tests/src/qrcode/decoder/ModeTest.h +47 -0
  179. data/ext/qrscanner/zxing/format +2 -0
  180. data/ext/qrscanner/zxing/magick/src/MagickBitmapSource.cpp +99 -0
  181. data/ext/qrscanner/zxing/magick/src/MagickBitmapSource.h +49 -0
  182. data/ext/qrscanner/zxing/magick/src/example.cpp +83 -0
  183. data/ext/qrscanner/zxing/magick/src/main.cpp +241 -0
  184. data/ext/qrscanner/zxing/magick/src/qrscanner.cpp +188 -0
  185. data/ext/qrscanner/zxing/osx.xcodeproj/project.pbxproj +1045 -0
  186. data/ext/qrscanner/zxing/scons/scons-LICENSE +25 -0
  187. data/ext/qrscanner/zxing/scons/scons-README +204 -0
  188. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Action.py +1241 -0
  189. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Action.pyc +0 -0
  190. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Builder.py +877 -0
  191. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Builder.pyc +0 -0
  192. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/CacheDir.py +216 -0
  193. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/CacheDir.pyc +0 -0
  194. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Conftest.py +793 -0
  195. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Conftest.pyc +0 -0
  196. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Debug.py +220 -0
  197. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Debug.pyc +0 -0
  198. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Defaults.py +480 -0
  199. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Defaults.pyc +0 -0
  200. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Environment.py +2318 -0
  201. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Environment.pyc +0 -0
  202. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Errors.py +205 -0
  203. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Errors.pyc +0 -0
  204. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Executor.py +633 -0
  205. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Executor.pyc +0 -0
  206. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Job.py +435 -0
  207. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Job.pyc +0 -0
  208. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Memoize.py +244 -0
  209. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Memoize.pyc +0 -0
  210. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Node/Alias.py +152 -0
  211. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Node/Alias.pyc +0 -0
  212. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Node/FS.py +3142 -0
  213. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Node/FS.pyc +0 -0
  214. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Node/Python.py +128 -0
  215. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Node/Python.pyc +0 -0
  216. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Node/__init__.py +1328 -0
  217. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Node/__init__.pyc +0 -0
  218. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Options/BoolOption.py +50 -0
  219. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Options/BoolOption.pyc +0 -0
  220. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Options/EnumOption.py +50 -0
  221. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Options/EnumOption.pyc +0 -0
  222. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Options/ListOption.py +50 -0
  223. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Options/ListOption.pyc +0 -0
  224. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Options/PackageOption.py +50 -0
  225. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Options/PackageOption.pyc +0 -0
  226. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Options/PathOption.py +76 -0
  227. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Options/PathOption.pyc +0 -0
  228. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Options/__init__.py +67 -0
  229. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Options/__init__.pyc +0 -0
  230. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/PathList.py +231 -0
  231. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/PathList.pyc +0 -0
  232. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Platform/__init__.py +241 -0
  233. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Platform/__init__.pyc +0 -0
  234. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Platform/aix.py +69 -0
  235. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Platform/cygwin.py +55 -0
  236. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Platform/darwin.py +46 -0
  237. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Platform/hpux.py +46 -0
  238. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Platform/irix.py +44 -0
  239. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Platform/os2.py +58 -0
  240. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Platform/posix.py +263 -0
  241. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Platform/posix.pyc +0 -0
  242. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Platform/sunos.py +50 -0
  243. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Platform/win32.py +385 -0
  244. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/SConf.py +1030 -0
  245. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/SConf.pyc +0 -0
  246. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/SConsign.py +383 -0
  247. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/SConsign.pyc +0 -0
  248. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Scanner/C.py +132 -0
  249. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Scanner/C.pyc +0 -0
  250. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Scanner/D.py +73 -0
  251. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Scanner/D.pyc +0 -0
  252. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Scanner/Dir.py +109 -0
  253. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Scanner/Dir.pyc +0 -0
  254. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Scanner/Fortran.py +316 -0
  255. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Scanner/Fortran.pyc +0 -0
  256. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Scanner/IDL.py +48 -0
  257. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Scanner/LaTeX.py +362 -0
  258. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Scanner/LaTeX.pyc +0 -0
  259. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Scanner/Prog.py +101 -0
  260. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Scanner/Prog.pyc +0 -0
  261. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Scanner/RC.py +55 -0
  262. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Scanner/__init__.py +413 -0
  263. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Scanner/__init__.pyc +0 -0
  264. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Script/Interactive.py +384 -0
  265. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Script/Interactive.pyc +0 -0
  266. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Script/Main.py +1334 -0
  267. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Script/Main.pyc +0 -0
  268. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Script/SConsOptions.py +939 -0
  269. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Script/SConsOptions.pyc +0 -0
  270. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Script/SConscript.py +640 -0
  271. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Script/SConscript.pyc +0 -0
  272. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Script/__init__.py +412 -0
  273. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Script/__init__.pyc +0 -0
  274. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Sig.py +63 -0
  275. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Subst.py +904 -0
  276. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Subst.pyc +0 -0
  277. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Taskmaster.py +1017 -0
  278. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Taskmaster.pyc +0 -0
  279. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/386asm.py +61 -0
  280. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/BitKeeper.py +67 -0
  281. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/BitKeeper.pyc +0 -0
  282. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/CVS.py +73 -0
  283. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/CVS.pyc +0 -0
  284. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/FortranCommon.py +246 -0
  285. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/FortranCommon.pyc +0 -0
  286. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/JavaCommon.py +323 -0
  287. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/JavaCommon.pyc +0 -0
  288. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/MSCommon/__init__.py +56 -0
  289. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/MSCommon/arch.py +61 -0
  290. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/MSCommon/common.py +240 -0
  291. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/MSCommon/netframework.py +82 -0
  292. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/MSCommon/sdk.py +391 -0
  293. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/MSCommon/vc.py +456 -0
  294. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/MSCommon/vs.py +499 -0
  295. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/Perforce.py +103 -0
  296. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/Perforce.pyc +0 -0
  297. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/PharLapCommon.py +137 -0
  298. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/PharLapCommon.pyc +0 -0
  299. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/RCS.py +64 -0
  300. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/RCS.pyc +0 -0
  301. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/SCCS.py +64 -0
  302. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/SCCS.pyc +0 -0
  303. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/Subversion.py +71 -0
  304. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/__init__.py +681 -0
  305. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/__init__.pyc +0 -0
  306. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/aixc++.py +82 -0
  307. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/aixcc.py +74 -0
  308. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/aixf77.py +80 -0
  309. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/aixlink.py +76 -0
  310. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/applelink.py +71 -0
  311. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/ar.py +63 -0
  312. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/ar.pyc +0 -0
  313. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/as.py +78 -0
  314. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/as.pyc +0 -0
  315. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/bcc32.py +81 -0
  316. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/c++.py +99 -0
  317. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/c++.pyc +0 -0
  318. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/cc.py +102 -0
  319. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/cc.pyc +0 -0
  320. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/cvf.py +58 -0
  321. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/default.py +50 -0
  322. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/default.pyc +0 -0
  323. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/dmd.py +223 -0
  324. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/dmd.pyc +0 -0
  325. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/dvi.py +64 -0
  326. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/dvipdf.py +124 -0
  327. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/dvipdf.pyc +0 -0
  328. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/dvips.py +94 -0
  329. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/dvips.pyc +0 -0
  330. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/f77.py +62 -0
  331. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/f77.pyc +0 -0
  332. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/f90.py +62 -0
  333. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/f90.pyc +0 -0
  334. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/f95.py +63 -0
  335. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/f95.pyc +0 -0
  336. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/filesystem.py +98 -0
  337. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/filesystem.pyc +0 -0
  338. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/fortran.py +62 -0
  339. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/fortran.pyc +0 -0
  340. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/g++.py +90 -0
  341. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/g++.pyc +0 -0
  342. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/g77.py +73 -0
  343. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/g77.pyc +0 -0
  344. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/gas.py +53 -0
  345. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/gas.pyc +0 -0
  346. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/gcc.py +80 -0
  347. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/gcc.pyc +0 -0
  348. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/gfortran.py +64 -0
  349. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/gfortran.pyc +0 -0
  350. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/gnulink.py +63 -0
  351. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/gnulink.pyc +0 -0
  352. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/gs.py +81 -0
  353. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/gs.pyc +0 -0
  354. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/hpc++.py +84 -0
  355. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/hpcc.py +53 -0
  356. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/hplink.py +77 -0
  357. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/icc.py +59 -0
  358. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/icl.py +52 -0
  359. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/ifl.py +72 -0
  360. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/ifl.pyc +0 -0
  361. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/ifort.py +88 -0
  362. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/ifort.pyc +0 -0
  363. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/ilink.py +59 -0
  364. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/ilink32.py +60 -0
  365. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/install.py +229 -0
  366. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/install.pyc +0 -0
  367. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/intelc.py +482 -0
  368. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/ipkg.py +67 -0
  369. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/jar.py +110 -0
  370. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/jar.pyc +0 -0
  371. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/javac.py +230 -0
  372. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/javac.pyc +0 -0
  373. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/javah.py +137 -0
  374. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/javah.pyc +0 -0
  375. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/latex.py +79 -0
  376. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/latex.pyc +0 -0
  377. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/lex.py +97 -0
  378. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/lex.pyc +0 -0
  379. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/link.py +121 -0
  380. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/link.pyc +0 -0
  381. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/linkloc.py +112 -0
  382. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/m4.py +63 -0
  383. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/m4.pyc +0 -0
  384. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/masm.py +77 -0
  385. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/midl.py +88 -0
  386. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/mingw.py +158 -0
  387. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/mslib.py +64 -0
  388. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/mslink.py +266 -0
  389. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/mssdk.py +50 -0
  390. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/msvc.py +268 -0
  391. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/msvs.py +1388 -0
  392. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/mwcc.py +207 -0
  393. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/mwld.py +107 -0
  394. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/nasm.py +72 -0
  395. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/packaging/__init__.py +312 -0
  396. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/packaging/ipk.py +185 -0
  397. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/packaging/msi.py +527 -0
  398. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/packaging/rpm.py +365 -0
  399. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/packaging/src_tarbz2.py +43 -0
  400. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/packaging/src_targz.py +43 -0
  401. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/packaging/src_zip.py +43 -0
  402. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/packaging/tarbz2.py +44 -0
  403. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/packaging/targz.py +44 -0
  404. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/packaging/zip.py +44 -0
  405. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/pdf.py +78 -0
  406. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/pdf.pyc +0 -0
  407. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/pdflatex.py +83 -0
  408. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/pdflatex.pyc +0 -0
  409. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/pdftex.py +108 -0
  410. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/pdftex.pyc +0 -0
  411. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/qt.py +336 -0
  412. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/rmic.py +120 -0
  413. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/rmic.pyc +0 -0
  414. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/rpcgen.py +70 -0
  415. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/rpcgen.pyc +0 -0
  416. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/rpm.py +132 -0
  417. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/rpm.pyc +0 -0
  418. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/sgiar.py +68 -0
  419. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/sgic++.py +58 -0
  420. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/sgicc.py +53 -0
  421. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/sgilink.py +63 -0
  422. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/sunar.py +67 -0
  423. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/sunc++.py +142 -0
  424. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/suncc.py +58 -0
  425. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/sunf77.py +63 -0
  426. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/sunf90.py +64 -0
  427. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/sunf95.py +64 -0
  428. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/sunlink.py +77 -0
  429. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/swig.py +182 -0
  430. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/swig.pyc +0 -0
  431. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/tar.py +73 -0
  432. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/tar.pyc +0 -0
  433. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/tex.py +807 -0
  434. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/tex.pyc +0 -0
  435. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/textfile.py +175 -0
  436. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/tlib.py +53 -0
  437. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/wix.py +99 -0
  438. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/wix.pyc +0 -0
  439. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/yacc.py +130 -0
  440. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/yacc.pyc +0 -0
  441. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/zip.py +99 -0
  442. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/zip.pyc +0 -0
  443. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Util.py +1496 -0
  444. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Util.pyc +0 -0
  445. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Variables/BoolVariable.py +89 -0
  446. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Variables/BoolVariable.pyc +0 -0
  447. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Variables/EnumVariable.py +103 -0
  448. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Variables/EnumVariable.pyc +0 -0
  449. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Variables/ListVariable.py +135 -0
  450. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Variables/ListVariable.pyc +0 -0
  451. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Variables/PackageVariable.py +106 -0
  452. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Variables/PackageVariable.pyc +0 -0
  453. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Variables/PathVariable.py +147 -0
  454. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Variables/PathVariable.pyc +0 -0
  455. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Variables/__init__.py +312 -0
  456. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Variables/__init__.pyc +0 -0
  457. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Warnings.py +246 -0
  458. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Warnings.pyc +0 -0
  459. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/__init__.py +49 -0
  460. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/__init__.pyc +0 -0
  461. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/compat/__init__.py +237 -0
  462. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/compat/__init__.pyc +0 -0
  463. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/compat/_scons_builtins.py +150 -0
  464. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/compat/_scons_builtins.pyc +0 -0
  465. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/compat/_scons_collections.py +45 -0
  466. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/compat/_scons_dbm.py +45 -0
  467. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/compat/_scons_hashlib.py +76 -0
  468. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/compat/_scons_io.py +45 -0
  469. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/compat/_scons_sets.py +563 -0
  470. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/compat/_scons_subprocess.py +1281 -0
  471. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/cpp.py +589 -0
  472. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/cpp.pyc +0 -0
  473. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/dblite.py +251 -0
  474. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/dblite.pyc +0 -0
  475. data/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/exitfuncs.py +77 -0
  476. data/ext/qrscanner/zxing/scons/scons-time.py +1544 -0
  477. data/ext/qrscanner/zxing/scons/scons.py +196 -0
  478. data/ext/qrscanner/zxing/scons/sconsign.py +513 -0
  479. data/qrscanner.gemspec +33 -0
  480. metadata +1023 -0
@@ -0,0 +1,251 @@
1
+ # dblite.py module contributed by Ralf W. Grosse-Kunstleve.
2
+ # Extended for Unicode by Steven Knight.
3
+
4
+ import SCons.compat
5
+
6
+ import builtins
7
+ import os
8
+ # compat layer imports "cPickle" for us if it's available.
9
+ import pickle
10
+ import shutil
11
+ import time
12
+
13
+ keep_all_files = 00000
14
+ ignore_corrupt_dbfiles = 0
15
+
16
+ def corruption_warning(filename):
17
+ print "Warning: Discarding corrupt database:", filename
18
+
19
+ try: unicode
20
+ except NameError:
21
+ def is_string(s):
22
+ return isinstance(s, str)
23
+ else:
24
+ def is_string(s):
25
+ return type(s) in (str, unicode)
26
+
27
+ try:
28
+ unicode('a')
29
+ except NameError:
30
+ def unicode(s): return s
31
+
32
+ dblite_suffix = '.dblite'
33
+ tmp_suffix = '.tmp'
34
+
35
+ class dblite(object):
36
+
37
+ # Squirrel away references to the functions in various modules
38
+ # that we'll use when our __del__() method calls our sync() method
39
+ # during shutdown. We might get destroyed when Python is in the midst
40
+ # of tearing down the different modules we import in an essentially
41
+ # arbitrary order, and some of the various modules's global attributes
42
+ # may already be wiped out from under us.
43
+ #
44
+ # See the discussion at:
45
+ # http://mail.python.org/pipermail/python-bugs-list/2003-March/016877.html
46
+
47
+ _open = builtins.open
48
+ _pickle_dump = staticmethod(pickle.dump)
49
+ _os_chmod = os.chmod
50
+ try:
51
+ _os_chown = os.chown
52
+ except AttributeError:
53
+ _os_chown = None
54
+ _os_rename = os.rename
55
+ _os_unlink = os.unlink
56
+ _shutil_copyfile = shutil.copyfile
57
+ _time_time = time.time
58
+
59
+ def __init__(self, file_base_name, flag, mode):
60
+ assert flag in (None, "r", "w", "c", "n")
61
+ if (flag is None): flag = "r"
62
+ base, ext = os.path.splitext(file_base_name)
63
+ if ext == dblite_suffix:
64
+ # There's already a suffix on the file name, don't add one.
65
+ self._file_name = file_base_name
66
+ self._tmp_name = base + tmp_suffix
67
+ else:
68
+ self._file_name = file_base_name + dblite_suffix
69
+ self._tmp_name = file_base_name + tmp_suffix
70
+ self._flag = flag
71
+ self._mode = mode
72
+ self._dict = {}
73
+ self._needs_sync = 00000
74
+ if self._os_chown is not None and (os.geteuid()==0 or os.getuid()==0):
75
+ # running as root; chown back to current owner/group when done
76
+ try:
77
+ statinfo = os.stat(self._file_name)
78
+ self._chown_to = statinfo.st_uid
79
+ self._chgrp_to = statinfo.st_gid
80
+ except OSError, e:
81
+ # db file doesn't exist yet.
82
+ # Check os.environ for SUDO_UID, use if set
83
+ self._chown_to = int(os.environ.get('SUDO_UID', -1))
84
+ self._chgrp_to = int(os.environ.get('SUDO_GID', -1))
85
+ else:
86
+ self._chown_to = -1 # don't chown
87
+ self._chgrp_to = -1 # don't chgrp
88
+ if (self._flag == "n"):
89
+ self._open(self._file_name, "wb", self._mode)
90
+ else:
91
+ try:
92
+ f = self._open(self._file_name, "rb")
93
+ except IOError, e:
94
+ if (self._flag != "c"):
95
+ raise e
96
+ self._open(self._file_name, "wb", self._mode)
97
+ else:
98
+ p = f.read()
99
+ if (len(p) > 0):
100
+ try:
101
+ self._dict = pickle.loads(p)
102
+ except (pickle.UnpicklingError, EOFError):
103
+ if (ignore_corrupt_dbfiles == 0): raise
104
+ if (ignore_corrupt_dbfiles == 1):
105
+ corruption_warning(self._file_name)
106
+
107
+ def __del__(self):
108
+ if (self._needs_sync):
109
+ self.sync()
110
+
111
+ def sync(self):
112
+ self._check_writable()
113
+ f = self._open(self._tmp_name, "wb", self._mode)
114
+ self._pickle_dump(self._dict, f, 1)
115
+ f.close()
116
+ # Windows doesn't allow renaming if the file exists, so unlink
117
+ # it first, chmod'ing it to make sure we can do so. On UNIX, we
118
+ # may not be able to chmod the file if it's owned by someone else
119
+ # (e.g. from a previous run as root). We should still be able to
120
+ # unlink() the file if the directory's writable, though, so ignore
121
+ # any OSError exception thrown by the chmod() call.
122
+ try: self._os_chmod(self._file_name, 0777)
123
+ except OSError: pass
124
+ self._os_unlink(self._file_name)
125
+ self._os_rename(self._tmp_name, self._file_name)
126
+ if self._os_chown is not None and self._chown_to > 0: # don't chown to root or -1
127
+ try:
128
+ self._os_chown(self._file_name, self._chown_to, self._chgrp_to)
129
+ except OSError:
130
+ pass
131
+ self._needs_sync = 00000
132
+ if (keep_all_files):
133
+ self._shutil_copyfile(
134
+ self._file_name,
135
+ self._file_name + "_" + str(int(self._time_time())))
136
+
137
+ def _check_writable(self):
138
+ if (self._flag == "r"):
139
+ raise IOError("Read-only database: %s" % self._file_name)
140
+
141
+ def __getitem__(self, key):
142
+ return self._dict[key]
143
+
144
+ def __setitem__(self, key, value):
145
+ self._check_writable()
146
+ if (not is_string(key)):
147
+ raise TypeError("key `%s' must be a string but is %s" % (key, type(key)))
148
+ if (not is_string(value)):
149
+ raise TypeError("value `%s' must be a string but is %s" % (value, type(value)))
150
+ self._dict[key] = value
151
+ self._needs_sync = 0001
152
+
153
+ def keys(self):
154
+ return list(self._dict.keys())
155
+
156
+ def has_key(self, key):
157
+ return key in self._dict
158
+
159
+ def __contains__(self, key):
160
+ return key in self._dict
161
+
162
+ def iterkeys(self):
163
+ # Wrapping name in () prevents fixer from "fixing" this
164
+ return (self._dict.iterkeys)()
165
+
166
+ __iter__ = iterkeys
167
+
168
+ def __len__(self):
169
+ return len(self._dict)
170
+
171
+ def open(file, flag=None, mode=0666):
172
+ return dblite(file, flag, mode)
173
+
174
+ def _exercise():
175
+ db = open("tmp", "n")
176
+ assert len(db) == 0
177
+ db["foo"] = "bar"
178
+ assert db["foo"] == "bar"
179
+ db[unicode("ufoo")] = unicode("ubar")
180
+ assert db[unicode("ufoo")] == unicode("ubar")
181
+ db.sync()
182
+ db = open("tmp", "c")
183
+ assert len(db) == 2, len(db)
184
+ assert db["foo"] == "bar"
185
+ db["bar"] = "foo"
186
+ assert db["bar"] == "foo"
187
+ db[unicode("ubar")] = unicode("ufoo")
188
+ assert db[unicode("ubar")] == unicode("ufoo")
189
+ db.sync()
190
+ db = open("tmp", "r")
191
+ assert len(db) == 4, len(db)
192
+ assert db["foo"] == "bar"
193
+ assert db["bar"] == "foo"
194
+ assert db[unicode("ufoo")] == unicode("ubar")
195
+ assert db[unicode("ubar")] == unicode("ufoo")
196
+ try:
197
+ db.sync()
198
+ except IOError, e:
199
+ assert str(e) == "Read-only database: tmp.dblite"
200
+ else:
201
+ raise RuntimeError("IOError expected.")
202
+ db = open("tmp", "w")
203
+ assert len(db) == 4
204
+ db["ping"] = "pong"
205
+ db.sync()
206
+ try:
207
+ db[(1,2)] = "tuple"
208
+ except TypeError, e:
209
+ assert str(e) == "key `(1, 2)' must be a string but is <type 'tuple'>", str(e)
210
+ else:
211
+ raise RuntimeError("TypeError exception expected")
212
+ try:
213
+ db["list"] = [1,2]
214
+ except TypeError, e:
215
+ assert str(e) == "value `[1, 2]' must be a string but is <type 'list'>", str(e)
216
+ else:
217
+ raise RuntimeError("TypeError exception expected")
218
+ db = open("tmp", "r")
219
+ assert len(db) == 5
220
+ db = open("tmp", "n")
221
+ assert len(db) == 0
222
+ dblite._open("tmp.dblite", "w")
223
+ db = open("tmp", "r")
224
+ dblite._open("tmp.dblite", "w").write("x")
225
+ try:
226
+ db = open("tmp", "r")
227
+ except pickle.UnpicklingError:
228
+ pass
229
+ else:
230
+ raise RuntimeError("pickle exception expected.")
231
+ global ignore_corrupt_dbfiles
232
+ ignore_corrupt_dbfiles = 2
233
+ db = open("tmp", "r")
234
+ assert len(db) == 0
235
+ os.unlink("tmp.dblite")
236
+ try:
237
+ db = open("tmp", "w")
238
+ except IOError, e:
239
+ assert str(e) == "[Errno 2] No such file or directory: 'tmp.dblite'", str(e)
240
+ else:
241
+ raise RuntimeError("IOError expected.")
242
+ print "OK"
243
+
244
+ if (__name__ == "__main__"):
245
+ _exercise()
246
+
247
+ # Local Variables:
248
+ # tab-width:4
249
+ # indent-tabs-mode:nil
250
+ # End:
251
+ # vim: set expandtab tabstop=4 shiftwidth=4:
@@ -0,0 +1,77 @@
1
+ """SCons.exitfuncs
2
+
3
+ Register functions which are executed when SCons exits for any reason.
4
+
5
+ """
6
+
7
+ #
8
+ # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
9
+ #
10
+ # Permission is hereby granted, free of charge, to any person obtaining
11
+ # a copy of this software and associated documentation files (the
12
+ # "Software"), to deal in the Software without restriction, including
13
+ # without limitation the rights to use, copy, modify, merge, publish,
14
+ # distribute, sublicense, and/or sell copies of the Software, and to
15
+ # permit persons to whom the Software is furnished to do so, subject to
16
+ # the following conditions:
17
+ #
18
+ # The above copyright notice and this permission notice shall be included
19
+ # in all copies or substantial portions of the Software.
20
+ #
21
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
22
+ # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
23
+ # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
24
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
25
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
26
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
27
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28
+ #
29
+
30
+ __revision__ = "src/engine/SCons/exitfuncs.py 5023 2010/06/14 22:05:46 scons"
31
+
32
+
33
+
34
+ _exithandlers = []
35
+ def _run_exitfuncs():
36
+ """run any registered exit functions
37
+
38
+ _exithandlers is traversed in reverse order so functions are executed
39
+ last in, first out.
40
+ """
41
+
42
+ while _exithandlers:
43
+ func, targs, kargs = _exithandlers.pop()
44
+ func(*targs, **kargs)
45
+
46
+ def register(func, *targs, **kargs):
47
+ """register a function to be executed upon normal program termination
48
+
49
+ func - function to be called at exit
50
+ targs - optional arguments to pass to func
51
+ kargs - optional keyword arguments to pass to func
52
+ """
53
+ _exithandlers.append((func, targs, kargs))
54
+
55
+ import sys
56
+
57
+ try:
58
+ x = sys.exitfunc
59
+
60
+ # if x isn't our own exit func executive, assume it's another
61
+ # registered exit function - append it to our list...
62
+ if x != _run_exitfuncs:
63
+ register(x)
64
+
65
+ except AttributeError:
66
+ pass
67
+
68
+ # make our exit function get run by python when it exits:
69
+ sys.exitfunc = _run_exitfuncs
70
+
71
+ del sys
72
+
73
+ # Local Variables:
74
+ # tab-width:4
75
+ # indent-tabs-mode:nil
76
+ # End:
77
+ # vim: set expandtab tabstop=4 shiftwidth=4:
@@ -0,0 +1,1544 @@
1
+ #!/usr/bin/env python
2
+ #
3
+ # scons-time - run SCons timings and collect statistics
4
+ #
5
+ # A script for running a configuration through SCons with a standard
6
+ # set of invocations to collect timing and memory statistics and to
7
+ # capture the results in a consistent set of output files for display
8
+ # and analysis.
9
+ #
10
+
11
+ #
12
+ # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
13
+ #
14
+ # Permission is hereby granted, free of charge, to any person obtaining
15
+ # a copy of this software and associated documentation files (the
16
+ # "Software"), to deal in the Software without restriction, including
17
+ # without limitation the rights to use, copy, modify, merge, publish,
18
+ # distribute, sublicense, and/or sell copies of the Software, and to
19
+ # permit persons to whom the Software is furnished to do so, subject to
20
+ # the following conditions:
21
+ #
22
+ # The above copyright notice and this permission notice shall be included
23
+ # in all copies or substantial portions of the Software.
24
+ #
25
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
26
+ # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
27
+ # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
29
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
30
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
31
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32
+ from __future__ import division
33
+ from __future__ import nested_scopes
34
+
35
+ __revision__ = "src/script/scons-time.py 5023 2010/06/14 22:05:46 scons"
36
+
37
+ import getopt
38
+ import glob
39
+ import os
40
+ import re
41
+ import shutil
42
+ import sys
43
+ import tempfile
44
+ import time
45
+
46
+ try:
47
+ sorted
48
+ except NameError:
49
+ # Pre-2.4 Python has no sorted() function.
50
+ #
51
+ # The pre-2.4 Python list.sort() method does not support
52
+ # list.sort(key=) nor list.sort(reverse=) keyword arguments, so
53
+ # we must implement the functionality of those keyword arguments
54
+ # by hand instead of passing them to list.sort().
55
+ def sorted(iterable, cmp=None, key=None, reverse=False):
56
+ if key is not None:
57
+ result = [(key(x), x) for x in iterable]
58
+ else:
59
+ result = iterable[:]
60
+ if cmp is None:
61
+ # Pre-2.3 Python does not support list.sort(None).
62
+ result.sort()
63
+ else:
64
+ result.sort(cmp)
65
+ if key is not None:
66
+ result = [t1 for t0,t1 in result]
67
+ if reverse:
68
+ result.reverse()
69
+ return result
70
+
71
+ if os.environ.get('SCONS_HORRIBLE_REGRESSION_TEST_HACK') is not None:
72
+ # We can't apply the 'callable' fixer until the floor is 2.6, but the
73
+ # '-3' option to Python 2.6 and 2.7 generates almost ten thousand
74
+ # warnings. This hack allows us to run regression tests with the '-3'
75
+ # option by replacing the callable() built-in function with a hack
76
+ # that performs the same function but doesn't generate the warning.
77
+ # Note that this hack is ONLY intended to be used for regression
78
+ # testing, and should NEVER be used for real runs.
79
+ from types import ClassType
80
+ def callable(obj):
81
+ if hasattr(obj, '__call__'): return True
82
+ if isinstance(obj, (ClassType, type)): return True
83
+ return False
84
+
85
+ def make_temp_file(**kw):
86
+ try:
87
+ result = tempfile.mktemp(**kw)
88
+ try:
89
+ result = os.path.realpath(result)
90
+ except AttributeError:
91
+ # Python 2.1 has no os.path.realpath() method.
92
+ pass
93
+ except TypeError:
94
+ try:
95
+ save_template = tempfile.template
96
+ prefix = kw['prefix']
97
+ del kw['prefix']
98
+ tempfile.template = prefix
99
+ result = tempfile.mktemp(**kw)
100
+ finally:
101
+ tempfile.template = save_template
102
+ return result
103
+
104
+ def HACK_for_exec(cmd, *args):
105
+ '''
106
+ For some reason, Python won't allow an exec() within a function
107
+ that also declares an internal function (including lambda functions).
108
+ This function is a hack that calls exec() in a function with no
109
+ internal functions.
110
+ '''
111
+ if not args: exec(cmd)
112
+ elif len(args) == 1: exec cmd in args[0]
113
+ else: exec cmd in args[0], args[1]
114
+
115
+ class Plotter(object):
116
+ def increment_size(self, largest):
117
+ """
118
+ Return the size of each horizontal increment line for a specified
119
+ maximum value. This returns a value that will provide somewhere
120
+ between 5 and 9 horizontal lines on the graph, on some set of
121
+ boundaries that are multiples of 10/100/1000/etc.
122
+ """
123
+ i = largest // 5
124
+ if not i:
125
+ return largest
126
+ multiplier = 1
127
+ while i >= 10:
128
+ i = i // 10
129
+ multiplier = multiplier * 10
130
+ return i * multiplier
131
+
132
+ def max_graph_value(self, largest):
133
+ # Round up to next integer.
134
+ largest = int(largest) + 1
135
+ increment = self.increment_size(largest)
136
+ return ((largest + increment - 1) // increment) * increment
137
+
138
+ class Line(object):
139
+ def __init__(self, points, type, title, label, comment, fmt="%s %s"):
140
+ self.points = points
141
+ self.type = type
142
+ self.title = title
143
+ self.label = label
144
+ self.comment = comment
145
+ self.fmt = fmt
146
+
147
+ def print_label(self, inx, x, y):
148
+ if self.label:
149
+ print 'set label %s "%s" at %s,%s right' % (inx, self.label, x, y)
150
+
151
+ def plot_string(self):
152
+ if self.title:
153
+ title_string = 'title "%s"' % self.title
154
+ else:
155
+ title_string = 'notitle'
156
+ return "'-' %s with lines lt %s" % (title_string, self.type)
157
+
158
+ def print_points(self, fmt=None):
159
+ if fmt is None:
160
+ fmt = self.fmt
161
+ if self.comment:
162
+ print '# %s' % self.comment
163
+ for x, y in self.points:
164
+ # If y is None, it usually represents some kind of break
165
+ # in the line's index number. We might want to represent
166
+ # this some way rather than just drawing the line straight
167
+ # between the two points on either side.
168
+ if not y is None:
169
+ print fmt % (x, y)
170
+ print 'e'
171
+
172
+ def get_x_values(self):
173
+ return [ p[0] for p in self.points ]
174
+
175
+ def get_y_values(self):
176
+ return [ p[1] for p in self.points ]
177
+
178
+ class Gnuplotter(Plotter):
179
+
180
+ def __init__(self, title, key_location):
181
+ self.lines = []
182
+ self.title = title
183
+ self.key_location = key_location
184
+
185
+ def line(self, points, type, title=None, label=None, comment=None, fmt='%s %s'):
186
+ if points:
187
+ line = Line(points, type, title, label, comment, fmt)
188
+ self.lines.append(line)
189
+
190
+ def plot_string(self, line):
191
+ return line.plot_string()
192
+
193
+ def vertical_bar(self, x, type, label, comment):
194
+ if self.get_min_x() <= x and x <= self.get_max_x():
195
+ points = [(x, 0), (x, self.max_graph_value(self.get_max_y()))]
196
+ self.line(points, type, label, comment)
197
+
198
+ def get_all_x_values(self):
199
+ result = []
200
+ for line in self.lines:
201
+ result.extend(line.get_x_values())
202
+ return [r for r in result if not r is None]
203
+
204
+ def get_all_y_values(self):
205
+ result = []
206
+ for line in self.lines:
207
+ result.extend(line.get_y_values())
208
+ return [r for r in result if not r is None]
209
+
210
+ def get_min_x(self):
211
+ try:
212
+ return self.min_x
213
+ except AttributeError:
214
+ try:
215
+ self.min_x = min(self.get_all_x_values())
216
+ except ValueError:
217
+ self.min_x = 0
218
+ return self.min_x
219
+
220
+ def get_max_x(self):
221
+ try:
222
+ return self.max_x
223
+ except AttributeError:
224
+ try:
225
+ self.max_x = max(self.get_all_x_values())
226
+ except ValueError:
227
+ self.max_x = 0
228
+ return self.max_x
229
+
230
+ def get_min_y(self):
231
+ try:
232
+ return self.min_y
233
+ except AttributeError:
234
+ try:
235
+ self.min_y = min(self.get_all_y_values())
236
+ except ValueError:
237
+ self.min_y = 0
238
+ return self.min_y
239
+
240
+ def get_max_y(self):
241
+ try:
242
+ return self.max_y
243
+ except AttributeError:
244
+ try:
245
+ self.max_y = max(self.get_all_y_values())
246
+ except ValueError:
247
+ self.max_y = 0
248
+ return self.max_y
249
+
250
+ def draw(self):
251
+
252
+ if not self.lines:
253
+ return
254
+
255
+ if self.title:
256
+ print 'set title "%s"' % self.title
257
+ print 'set key %s' % self.key_location
258
+
259
+ min_y = self.get_min_y()
260
+ max_y = self.max_graph_value(self.get_max_y())
261
+ incr = (max_y - min_y) / 10.0
262
+ start = min_y + (max_y / 2.0) + (2.0 * incr)
263
+ position = [ start - (i * incr) for i in range(5) ]
264
+
265
+ inx = 1
266
+ for line in self.lines:
267
+ line.print_label(inx, line.points[0][0]-1,
268
+ position[(inx-1) % len(position)])
269
+ inx += 1
270
+
271
+ plot_strings = [ self.plot_string(l) for l in self.lines ]
272
+ print 'plot ' + ', \\\n '.join(plot_strings)
273
+
274
+ for line in self.lines:
275
+ line.print_points()
276
+
277
+
278
+
279
+ def untar(fname):
280
+ import tarfile
281
+ tar = tarfile.open(name=fname, mode='r')
282
+ for tarinfo in tar:
283
+ tar.extract(tarinfo)
284
+ tar.close()
285
+
286
+ def unzip(fname):
287
+ import zipfile
288
+ zf = zipfile.ZipFile(fname, 'r')
289
+ for name in zf.namelist():
290
+ dir = os.path.dirname(name)
291
+ try:
292
+ os.makedirs(dir)
293
+ except:
294
+ pass
295
+ open(name, 'w').write(zf.read(name))
296
+
297
+ def read_tree(dir):
298
+ for dirpath, dirnames, filenames in os.walk(dir):
299
+ for fn in filenames:
300
+ fn = os.path.join(dirpath, fn)
301
+ if os.path.isfile(fn):
302
+ open(fn, 'rb').read()
303
+
304
+ def redirect_to_file(command, log):
305
+ return '%s > %s 2>&1' % (command, log)
306
+
307
+ def tee_to_file(command, log):
308
+ return '%s 2>&1 | tee %s' % (command, log)
309
+
310
+
311
+
312
+ class SConsTimer(object):
313
+ """
314
+ Usage: scons-time SUBCOMMAND [ARGUMENTS]
315
+ Type "scons-time help SUBCOMMAND" for help on a specific subcommand.
316
+
317
+ Available subcommands:
318
+ func Extract test-run data for a function
319
+ help Provides help
320
+ mem Extract --debug=memory data from test runs
321
+ obj Extract --debug=count data from test runs
322
+ time Extract --debug=time data from test runs
323
+ run Runs a test configuration
324
+ """
325
+
326
+ name = 'scons-time'
327
+ name_spaces = ' '*len(name)
328
+
329
+ def makedict(**kw):
330
+ return kw
331
+
332
+ default_settings = makedict(
333
+ aegis = 'aegis',
334
+ aegis_project = None,
335
+ chdir = None,
336
+ config_file = None,
337
+ initial_commands = [],
338
+ key_location = 'bottom left',
339
+ orig_cwd = os.getcwd(),
340
+ outdir = None,
341
+ prefix = '',
342
+ python = '"%s"' % sys.executable,
343
+ redirect = redirect_to_file,
344
+ scons = None,
345
+ scons_flags = '--debug=count --debug=memory --debug=time --debug=memoizer',
346
+ scons_lib_dir = None,
347
+ scons_wrapper = None,
348
+ startup_targets = '--help',
349
+ subdir = None,
350
+ subversion_url = None,
351
+ svn = 'svn',
352
+ svn_co_flag = '-q',
353
+ tar = 'tar',
354
+ targets = '',
355
+ targets0 = None,
356
+ targets1 = None,
357
+ targets2 = None,
358
+ title = None,
359
+ unzip = 'unzip',
360
+ verbose = False,
361
+ vertical_bars = [],
362
+
363
+ unpack_map = {
364
+ '.tar.gz' : (untar, '%(tar)s xzf %%s'),
365
+ '.tgz' : (untar, '%(tar)s xzf %%s'),
366
+ '.tar' : (untar, '%(tar)s xf %%s'),
367
+ '.zip' : (unzip, '%(unzip)s %%s'),
368
+ },
369
+ )
370
+
371
+ run_titles = [
372
+ 'Startup',
373
+ 'Full build',
374
+ 'Up-to-date build',
375
+ ]
376
+
377
+ run_commands = [
378
+ '%(python)s %(scons_wrapper)s %(scons_flags)s --profile=%(prof0)s %(targets0)s',
379
+ '%(python)s %(scons_wrapper)s %(scons_flags)s --profile=%(prof1)s %(targets1)s',
380
+ '%(python)s %(scons_wrapper)s %(scons_flags)s --profile=%(prof2)s %(targets2)s',
381
+ ]
382
+
383
+ stages = [
384
+ 'pre-read',
385
+ 'post-read',
386
+ 'pre-build',
387
+ 'post-build',
388
+ ]
389
+
390
+ stage_strings = {
391
+ 'pre-read' : 'Memory before reading SConscript files:',
392
+ 'post-read' : 'Memory after reading SConscript files:',
393
+ 'pre-build' : 'Memory before building targets:',
394
+ 'post-build' : 'Memory after building targets:',
395
+ }
396
+
397
+ memory_string_all = 'Memory '
398
+
399
+ default_stage = stages[-1]
400
+
401
+ time_strings = {
402
+ 'total' : 'Total build time',
403
+ 'SConscripts' : 'Total SConscript file execution time',
404
+ 'SCons' : 'Total SCons execution time',
405
+ 'commands' : 'Total command execution time',
406
+ }
407
+
408
+ time_string_all = 'Total .* time'
409
+
410
+ #
411
+
412
+ def __init__(self):
413
+ self.__dict__.update(self.default_settings)
414
+
415
+ # Functions for displaying and executing commands.
416
+
417
+ def subst(self, x, dictionary):
418
+ try:
419
+ return x % dictionary
420
+ except TypeError:
421
+ # x isn't a string (it's probably a Python function),
422
+ # so just return it.
423
+ return x
424
+
425
+ def subst_variables(self, command, dictionary):
426
+ """
427
+ Substitutes (via the format operator) the values in the specified
428
+ dictionary into the specified command.
429
+
430
+ The command can be an (action, string) tuple. In all cases, we
431
+ perform substitution on strings and don't worry if something isn't
432
+ a string. (It's probably a Python function to be executed.)
433
+ """
434
+ try:
435
+ command + ''
436
+ except TypeError:
437
+ action = command[0]
438
+ string = command[1]
439
+ args = command[2:]
440
+ else:
441
+ action = command
442
+ string = action
443
+ args = (())
444
+ action = self.subst(action, dictionary)
445
+ string = self.subst(string, dictionary)
446
+ return (action, string, args)
447
+
448
+ def _do_not_display(self, msg, *args):
449
+ pass
450
+
451
+ def display(self, msg, *args):
452
+ """
453
+ Displays the specified message.
454
+
455
+ Each message is prepended with a standard prefix of our name
456
+ plus the time.
457
+ """
458
+ if callable(msg):
459
+ msg = msg(*args)
460
+ else:
461
+ msg = msg % args
462
+ if msg is None:
463
+ return
464
+ fmt = '%s[%s]: %s\n'
465
+ sys.stdout.write(fmt % (self.name, time.strftime('%H:%M:%S'), msg))
466
+
467
+ def _do_not_execute(self, action, *args):
468
+ pass
469
+
470
+ def execute(self, action, *args):
471
+ """
472
+ Executes the specified action.
473
+
474
+ The action is called if it's a callable Python function, and
475
+ otherwise passed to os.system().
476
+ """
477
+ if callable(action):
478
+ action(*args)
479
+ else:
480
+ os.system(action % args)
481
+
482
+ def run_command_list(self, commands, dict):
483
+ """
484
+ Executes a list of commands, substituting values from the
485
+ specified dictionary.
486
+ """
487
+ commands = [ self.subst_variables(c, dict) for c in commands ]
488
+ for action, string, args in commands:
489
+ self.display(string, *args)
490
+ sys.stdout.flush()
491
+ status = self.execute(action, *args)
492
+ if status:
493
+ sys.exit(status)
494
+
495
+ def log_display(self, command, log):
496
+ command = self.subst(command, self.__dict__)
497
+ if log:
498
+ command = self.redirect(command, log)
499
+ return command
500
+
501
+ def log_execute(self, command, log):
502
+ command = self.subst(command, self.__dict__)
503
+ output = os.popen(command).read()
504
+ if self.verbose:
505
+ sys.stdout.write(output)
506
+ open(log, 'wb').write(output)
507
+
508
+ #
509
+
510
+ def archive_splitext(self, path):
511
+ """
512
+ Splits an archive name into a filename base and extension.
513
+
514
+ This is like os.path.splitext() (which it calls) except that it
515
+ also looks for '.tar.gz' and treats it as an atomic extensions.
516
+ """
517
+ if path.endswith('.tar.gz'):
518
+ return path[:-7], path[-7:]
519
+ else:
520
+ return os.path.splitext(path)
521
+
522
+ def args_to_files(self, args, tail=None):
523
+ """
524
+ Takes a list of arguments, expands any glob patterns, and
525
+ returns the last "tail" files from the list.
526
+ """
527
+ files = []
528
+ for a in args:
529
+ files.extend(sorted(glob.glob(a)))
530
+
531
+ if tail:
532
+ files = files[-tail:]
533
+
534
+ return files
535
+
536
+ def ascii_table(self, files, columns,
537
+ line_function, file_function=lambda x: x,
538
+ *args, **kw):
539
+
540
+ header_fmt = ' '.join(['%12s'] * len(columns))
541
+ line_fmt = header_fmt + ' %s'
542
+
543
+ print header_fmt % columns
544
+
545
+ for file in files:
546
+ t = line_function(file, *args, **kw)
547
+ if t is None:
548
+ t = []
549
+ diff = len(columns) - len(t)
550
+ if diff > 0:
551
+ t += [''] * diff
552
+ t.append(file_function(file))
553
+ print line_fmt % tuple(t)
554
+
555
+ def collect_results(self, files, function, *args, **kw):
556
+ results = {}
557
+
558
+ for file in files:
559
+ base = os.path.splitext(file)[0]
560
+ run, index = base.split('-')[-2:]
561
+
562
+ run = int(run)
563
+ index = int(index)
564
+
565
+ value = function(file, *args, **kw)
566
+
567
+ try:
568
+ r = results[index]
569
+ except KeyError:
570
+ r = []
571
+ results[index] = r
572
+ r.append((run, value))
573
+
574
+ return results
575
+
576
+ def doc_to_help(self, obj):
577
+ """
578
+ Translates an object's __doc__ string into help text.
579
+
580
+ This strips a consistent number of spaces from each line in the
581
+ help text, essentially "outdenting" the text to the left-most
582
+ column.
583
+ """
584
+ doc = obj.__doc__
585
+ if doc is None:
586
+ return ''
587
+ return self.outdent(doc)
588
+
589
+ def find_next_run_number(self, dir, prefix):
590
+ """
591
+ Returns the next run number in a directory for the specified prefix.
592
+
593
+ Examines the contents the specified directory for files with the
594
+ specified prefix, extracts the run numbers from each file name,
595
+ and returns the next run number after the largest it finds.
596
+ """
597
+ x = re.compile(re.escape(prefix) + '-([0-9]+).*')
598
+ matches = [x.match(e) for e in os.listdir(dir)]
599
+ matches = [_f for _f in matches if _f]
600
+ if not matches:
601
+ return 0
602
+ run_numbers = [int(m.group(1)) for m in matches]
603
+ return int(max(run_numbers)) + 1
604
+
605
+ def gnuplot_results(self, results, fmt='%s %.3f'):
606
+ """
607
+ Prints out a set of results in Gnuplot format.
608
+ """
609
+ gp = Gnuplotter(self.title, self.key_location)
610
+
611
+ for i in sorted(results.keys()):
612
+ try:
613
+ t = self.run_titles[i]
614
+ except IndexError:
615
+ t = '??? %s ???' % i
616
+ results[i].sort()
617
+ gp.line(results[i], i+1, t, None, t, fmt=fmt)
618
+
619
+ for bar_tuple in self.vertical_bars:
620
+ try:
621
+ x, type, label, comment = bar_tuple
622
+ except ValueError:
623
+ x, type, label = bar_tuple
624
+ comment = label
625
+ gp.vertical_bar(x, type, label, comment)
626
+
627
+ gp.draw()
628
+
629
+ def logfile_name(self, invocation):
630
+ """
631
+ Returns the absolute path of a log file for the specificed
632
+ invocation number.
633
+ """
634
+ name = self.prefix_run + '-%d.log' % invocation
635
+ return os.path.join(self.outdir, name)
636
+
637
+ def outdent(self, s):
638
+ """
639
+ Strip as many spaces from each line as are found at the beginning
640
+ of the first line in the list.
641
+ """
642
+ lines = s.split('\n')
643
+ if lines[0] == '':
644
+ lines = lines[1:]
645
+ spaces = re.match(' *', lines[0]).group(0)
646
+ def strip_initial_spaces(l, s=spaces):
647
+ if l.startswith(spaces):
648
+ l = l[len(spaces):]
649
+ return l
650
+ return '\n'.join([ strip_initial_spaces(l) for l in lines ]) + '\n'
651
+
652
+ def profile_name(self, invocation):
653
+ """
654
+ Returns the absolute path of a profile file for the specified
655
+ invocation number.
656
+ """
657
+ name = self.prefix_run + '-%d.prof' % invocation
658
+ return os.path.join(self.outdir, name)
659
+
660
+ def set_env(self, key, value):
661
+ os.environ[key] = value
662
+
663
+ #
664
+
665
+ def get_debug_times(self, file, time_string=None):
666
+ """
667
+ Fetch times from the --debug=time strings in the specified file.
668
+ """
669
+ if time_string is None:
670
+ search_string = self.time_string_all
671
+ else:
672
+ search_string = time_string
673
+ contents = open(file).read()
674
+ if not contents:
675
+ sys.stderr.write('file %s has no contents!\n' % repr(file))
676
+ return None
677
+ result = re.findall(r'%s: ([\d\.]*)' % search_string, contents)[-4:]
678
+ result = [ float(r) for r in result ]
679
+ if not time_string is None:
680
+ try:
681
+ result = result[0]
682
+ except IndexError:
683
+ sys.stderr.write('file %s has no results!\n' % repr(file))
684
+ return None
685
+ return result
686
+
687
+ def get_function_profile(self, file, function):
688
+ """
689
+ Returns the file, line number, function name, and cumulative time.
690
+ """
691
+ try:
692
+ import pstats
693
+ except ImportError, e:
694
+ sys.stderr.write('%s: func: %s\n' % (self.name, e))
695
+ sys.stderr.write('%s This version of Python is missing the profiler.\n' % self.name_spaces)
696
+ sys.stderr.write('%s Cannot use the "func" subcommand.\n' % self.name_spaces)
697
+ sys.exit(1)
698
+ statistics = pstats.Stats(file).stats
699
+ matches = [ e for e in statistics.items() if e[0][2] == function ]
700
+ r = matches[0]
701
+ return r[0][0], r[0][1], r[0][2], r[1][3]
702
+
703
+ def get_function_time(self, file, function):
704
+ """
705
+ Returns just the cumulative time for the specified function.
706
+ """
707
+ return self.get_function_profile(file, function)[3]
708
+
709
+ def get_memory(self, file, memory_string=None):
710
+ """
711
+ Returns a list of integers of the amount of memory used. The
712
+ default behavior is to return all the stages.
713
+ """
714
+ if memory_string is None:
715
+ search_string = self.memory_string_all
716
+ else:
717
+ search_string = memory_string
718
+ lines = open(file).readlines()
719
+ lines = [ l for l in lines if l.startswith(search_string) ][-4:]
720
+ result = [ int(l.split()[-1]) for l in lines[-4:] ]
721
+ if len(result) == 1:
722
+ result = result[0]
723
+ return result
724
+
725
+ def get_object_counts(self, file, object_name, index=None):
726
+ """
727
+ Returns the counts of the specified object_name.
728
+ """
729
+ object_string = ' ' + object_name + '\n'
730
+ lines = open(file).readlines()
731
+ line = [ l for l in lines if l.endswith(object_string) ][0]
732
+ result = [ int(field) for field in line.split()[:4] ]
733
+ if index is not None:
734
+ result = result[index]
735
+ return result
736
+
737
+ #
738
+
739
+ command_alias = {}
740
+
741
+ def execute_subcommand(self, argv):
742
+ """
743
+ Executes the do_*() function for the specified subcommand (argv[0]).
744
+ """
745
+ if not argv:
746
+ return
747
+ cmdName = self.command_alias.get(argv[0], argv[0])
748
+ try:
749
+ func = getattr(self, 'do_' + cmdName)
750
+ except AttributeError:
751
+ return self.default(argv)
752
+ try:
753
+ return func(argv)
754
+ except TypeError, e:
755
+ sys.stderr.write("%s %s: %s\n" % (self.name, cmdName, e))
756
+ import traceback
757
+ traceback.print_exc(file=sys.stderr)
758
+ sys.stderr.write("Try '%s help %s'\n" % (self.name, cmdName))
759
+
760
+ def default(self, argv):
761
+ """
762
+ The default behavior for an unknown subcommand. Prints an
763
+ error message and exits.
764
+ """
765
+ sys.stderr.write('%s: Unknown subcommand "%s".\n' % (self.name, argv[0]))
766
+ sys.stderr.write('Type "%s help" for usage.\n' % self.name)
767
+ sys.exit(1)
768
+
769
+ #
770
+
771
+ def do_help(self, argv):
772
+ """
773
+ """
774
+ if argv[1:]:
775
+ for arg in argv[1:]:
776
+ try:
777
+ func = getattr(self, 'do_' + arg)
778
+ except AttributeError:
779
+ sys.stderr.write('%s: No help for "%s"\n' % (self.name, arg))
780
+ else:
781
+ try:
782
+ help = getattr(self, 'help_' + arg)
783
+ except AttributeError:
784
+ sys.stdout.write(self.doc_to_help(func))
785
+ sys.stdout.flush()
786
+ else:
787
+ help()
788
+ else:
789
+ doc = self.doc_to_help(self.__class__)
790
+ if doc:
791
+ sys.stdout.write(doc)
792
+ sys.stdout.flush()
793
+ return None
794
+
795
+ #
796
+
797
+ def help_func(self):
798
+ help = """\
799
+ Usage: scons-time func [OPTIONS] FILE [...]
800
+
801
+ -C DIR, --chdir=DIR Change to DIR before looking for files
802
+ -f FILE, --file=FILE Read configuration from specified FILE
803
+ --fmt=FORMAT, --format=FORMAT Print data in specified FORMAT
804
+ --func=NAME, --function=NAME Report time for function NAME
805
+ -h, --help Print this help and exit
806
+ -p STRING, --prefix=STRING Use STRING as log file/profile prefix
807
+ -t NUMBER, --tail=NUMBER Only report the last NUMBER files
808
+ --title=TITLE Specify the output plot TITLE
809
+ """
810
+ sys.stdout.write(self.outdent(help))
811
+ sys.stdout.flush()
812
+
813
+ def do_func(self, argv):
814
+ """
815
+ """
816
+ format = 'ascii'
817
+ function_name = '_main'
818
+ tail = None
819
+
820
+ short_opts = '?C:f:hp:t:'
821
+
822
+ long_opts = [
823
+ 'chdir=',
824
+ 'file=',
825
+ 'fmt=',
826
+ 'format=',
827
+ 'func=',
828
+ 'function=',
829
+ 'help',
830
+ 'prefix=',
831
+ 'tail=',
832
+ 'title=',
833
+ ]
834
+
835
+ opts, args = getopt.getopt(argv[1:], short_opts, long_opts)
836
+
837
+ for o, a in opts:
838
+ if o in ('-C', '--chdir'):
839
+ self.chdir = a
840
+ elif o in ('-f', '--file'):
841
+ self.config_file = a
842
+ elif o in ('--fmt', '--format'):
843
+ format = a
844
+ elif o in ('--func', '--function'):
845
+ function_name = a
846
+ elif o in ('-?', '-h', '--help'):
847
+ self.do_help(['help', 'func'])
848
+ sys.exit(0)
849
+ elif o in ('--max',):
850
+ max_time = int(a)
851
+ elif o in ('-p', '--prefix'):
852
+ self.prefix = a
853
+ elif o in ('-t', '--tail'):
854
+ tail = int(a)
855
+ elif o in ('--title',):
856
+ self.title = a
857
+
858
+ if self.config_file:
859
+ exec open(self.config_file, 'rU').read() in self.__dict__
860
+
861
+ if self.chdir:
862
+ os.chdir(self.chdir)
863
+
864
+ if not args:
865
+
866
+ pattern = '%s*.prof' % self.prefix
867
+ args = self.args_to_files([pattern], tail)
868
+
869
+ if not args:
870
+ if self.chdir:
871
+ directory = self.chdir
872
+ else:
873
+ directory = os.getcwd()
874
+
875
+ sys.stderr.write('%s: func: No arguments specified.\n' % self.name)
876
+ sys.stderr.write('%s No %s*.prof files found in "%s".\n' % (self.name_spaces, self.prefix, directory))
877
+ sys.stderr.write('%s Type "%s help func" for help.\n' % (self.name_spaces, self.name))
878
+ sys.exit(1)
879
+
880
+ else:
881
+
882
+ args = self.args_to_files(args, tail)
883
+
884
+ cwd_ = os.getcwd() + os.sep
885
+
886
+ if format == 'ascii':
887
+
888
+ for file in args:
889
+ try:
890
+ f, line, func, time = \
891
+ self.get_function_profile(file, function_name)
892
+ except ValueError, e:
893
+ sys.stderr.write("%s: func: %s: %s\n" %
894
+ (self.name, file, e))
895
+ else:
896
+ if f.startswith(cwd_):
897
+ f = f[len(cwd_):]
898
+ print "%.3f %s:%d(%s)" % (time, f, line, func)
899
+
900
+ elif format == 'gnuplot':
901
+
902
+ results = self.collect_results(args, self.get_function_time,
903
+ function_name)
904
+
905
+ self.gnuplot_results(results)
906
+
907
+ else:
908
+
909
+ sys.stderr.write('%s: func: Unknown format "%s".\n' % (self.name, format))
910
+ sys.exit(1)
911
+
912
+ #
913
+
914
+ def help_mem(self):
915
+ help = """\
916
+ Usage: scons-time mem [OPTIONS] FILE [...]
917
+
918
+ -C DIR, --chdir=DIR Change to DIR before looking for files
919
+ -f FILE, --file=FILE Read configuration from specified FILE
920
+ --fmt=FORMAT, --format=FORMAT Print data in specified FORMAT
921
+ -h, --help Print this help and exit
922
+ -p STRING, --prefix=STRING Use STRING as log file/profile prefix
923
+ --stage=STAGE Plot memory at the specified stage:
924
+ pre-read, post-read, pre-build,
925
+ post-build (default: post-build)
926
+ -t NUMBER, --tail=NUMBER Only report the last NUMBER files
927
+ --title=TITLE Specify the output plot TITLE
928
+ """
929
+ sys.stdout.write(self.outdent(help))
930
+ sys.stdout.flush()
931
+
932
+ def do_mem(self, argv):
933
+
934
+ format = 'ascii'
935
+ logfile_path = lambda x: x
936
+ stage = self.default_stage
937
+ tail = None
938
+
939
+ short_opts = '?C:f:hp:t:'
940
+
941
+ long_opts = [
942
+ 'chdir=',
943
+ 'file=',
944
+ 'fmt=',
945
+ 'format=',
946
+ 'help',
947
+ 'prefix=',
948
+ 'stage=',
949
+ 'tail=',
950
+ 'title=',
951
+ ]
952
+
953
+ opts, args = getopt.getopt(argv[1:], short_opts, long_opts)
954
+
955
+ for o, a in opts:
956
+ if o in ('-C', '--chdir'):
957
+ self.chdir = a
958
+ elif o in ('-f', '--file'):
959
+ self.config_file = a
960
+ elif o in ('--fmt', '--format'):
961
+ format = a
962
+ elif o in ('-?', '-h', '--help'):
963
+ self.do_help(['help', 'mem'])
964
+ sys.exit(0)
965
+ elif o in ('-p', '--prefix'):
966
+ self.prefix = a
967
+ elif o in ('--stage',):
968
+ if not a in self.stages:
969
+ sys.stderr.write('%s: mem: Unrecognized stage "%s".\n' % (self.name, a))
970
+ sys.exit(1)
971
+ stage = a
972
+ elif o in ('-t', '--tail'):
973
+ tail = int(a)
974
+ elif o in ('--title',):
975
+ self.title = a
976
+
977
+ if self.config_file:
978
+ HACK_for_exec(open(self.config_file, 'rU').read(), self.__dict__)
979
+
980
+ if self.chdir:
981
+ os.chdir(self.chdir)
982
+ logfile_path = lambda x: os.path.join(self.chdir, x)
983
+
984
+ if not args:
985
+
986
+ pattern = '%s*.log' % self.prefix
987
+ args = self.args_to_files([pattern], tail)
988
+
989
+ if not args:
990
+ if self.chdir:
991
+ directory = self.chdir
992
+ else:
993
+ directory = os.getcwd()
994
+
995
+ sys.stderr.write('%s: mem: No arguments specified.\n' % self.name)
996
+ sys.stderr.write('%s No %s*.log files found in "%s".\n' % (self.name_spaces, self.prefix, directory))
997
+ sys.stderr.write('%s Type "%s help mem" for help.\n' % (self.name_spaces, self.name))
998
+ sys.exit(1)
999
+
1000
+ else:
1001
+
1002
+ args = self.args_to_files(args, tail)
1003
+
1004
+ cwd_ = os.getcwd() + os.sep
1005
+
1006
+ if format == 'ascii':
1007
+
1008
+ self.ascii_table(args, tuple(self.stages), self.get_memory, logfile_path)
1009
+
1010
+ elif format == 'gnuplot':
1011
+
1012
+ results = self.collect_results(args, self.get_memory,
1013
+ self.stage_strings[stage])
1014
+
1015
+ self.gnuplot_results(results)
1016
+
1017
+ else:
1018
+
1019
+ sys.stderr.write('%s: mem: Unknown format "%s".\n' % (self.name, format))
1020
+ sys.exit(1)
1021
+
1022
+ return 0
1023
+
1024
+ #
1025
+
1026
+ def help_obj(self):
1027
+ help = """\
1028
+ Usage: scons-time obj [OPTIONS] OBJECT FILE [...]
1029
+
1030
+ -C DIR, --chdir=DIR Change to DIR before looking for files
1031
+ -f FILE, --file=FILE Read configuration from specified FILE
1032
+ --fmt=FORMAT, --format=FORMAT Print data in specified FORMAT
1033
+ -h, --help Print this help and exit
1034
+ -p STRING, --prefix=STRING Use STRING as log file/profile prefix
1035
+ --stage=STAGE Plot memory at the specified stage:
1036
+ pre-read, post-read, pre-build,
1037
+ post-build (default: post-build)
1038
+ -t NUMBER, --tail=NUMBER Only report the last NUMBER files
1039
+ --title=TITLE Specify the output plot TITLE
1040
+ """
1041
+ sys.stdout.write(self.outdent(help))
1042
+ sys.stdout.flush()
1043
+
1044
+ def do_obj(self, argv):
1045
+
1046
+ format = 'ascii'
1047
+ logfile_path = lambda x: x
1048
+ stage = self.default_stage
1049
+ tail = None
1050
+
1051
+ short_opts = '?C:f:hp:t:'
1052
+
1053
+ long_opts = [
1054
+ 'chdir=',
1055
+ 'file=',
1056
+ 'fmt=',
1057
+ 'format=',
1058
+ 'help',
1059
+ 'prefix=',
1060
+ 'stage=',
1061
+ 'tail=',
1062
+ 'title=',
1063
+ ]
1064
+
1065
+ opts, args = getopt.getopt(argv[1:], short_opts, long_opts)
1066
+
1067
+ for o, a in opts:
1068
+ if o in ('-C', '--chdir'):
1069
+ self.chdir = a
1070
+ elif o in ('-f', '--file'):
1071
+ self.config_file = a
1072
+ elif o in ('--fmt', '--format'):
1073
+ format = a
1074
+ elif o in ('-?', '-h', '--help'):
1075
+ self.do_help(['help', 'obj'])
1076
+ sys.exit(0)
1077
+ elif o in ('-p', '--prefix'):
1078
+ self.prefix = a
1079
+ elif o in ('--stage',):
1080
+ if not a in self.stages:
1081
+ sys.stderr.write('%s: obj: Unrecognized stage "%s".\n' % (self.name, a))
1082
+ sys.stderr.write('%s Type "%s help obj" for help.\n' % (self.name_spaces, self.name))
1083
+ sys.exit(1)
1084
+ stage = a
1085
+ elif o in ('-t', '--tail'):
1086
+ tail = int(a)
1087
+ elif o in ('--title',):
1088
+ self.title = a
1089
+
1090
+ if not args:
1091
+ sys.stderr.write('%s: obj: Must specify an object name.\n' % self.name)
1092
+ sys.stderr.write('%s Type "%s help obj" for help.\n' % (self.name_spaces, self.name))
1093
+ sys.exit(1)
1094
+
1095
+ object_name = args.pop(0)
1096
+
1097
+ if self.config_file:
1098
+ HACK_for_exec(open(self.config_file, 'rU').read(), self.__dict__)
1099
+
1100
+ if self.chdir:
1101
+ os.chdir(self.chdir)
1102
+ logfile_path = lambda x: os.path.join(self.chdir, x)
1103
+
1104
+ if not args:
1105
+
1106
+ pattern = '%s*.log' % self.prefix
1107
+ args = self.args_to_files([pattern], tail)
1108
+
1109
+ if not args:
1110
+ if self.chdir:
1111
+ directory = self.chdir
1112
+ else:
1113
+ directory = os.getcwd()
1114
+
1115
+ sys.stderr.write('%s: obj: No arguments specified.\n' % self.name)
1116
+ sys.stderr.write('%s No %s*.log files found in "%s".\n' % (self.name_spaces, self.prefix, directory))
1117
+ sys.stderr.write('%s Type "%s help obj" for help.\n' % (self.name_spaces, self.name))
1118
+ sys.exit(1)
1119
+
1120
+ else:
1121
+
1122
+ args = self.args_to_files(args, tail)
1123
+
1124
+ cwd_ = os.getcwd() + os.sep
1125
+
1126
+ if format == 'ascii':
1127
+
1128
+ self.ascii_table(args, tuple(self.stages), self.get_object_counts, logfile_path, object_name)
1129
+
1130
+ elif format == 'gnuplot':
1131
+
1132
+ stage_index = 0
1133
+ for s in self.stages:
1134
+ if stage == s:
1135
+ break
1136
+ stage_index = stage_index + 1
1137
+
1138
+ results = self.collect_results(args, self.get_object_counts,
1139
+ object_name, stage_index)
1140
+
1141
+ self.gnuplot_results(results)
1142
+
1143
+ else:
1144
+
1145
+ sys.stderr.write('%s: obj: Unknown format "%s".\n' % (self.name, format))
1146
+ sys.exit(1)
1147
+
1148
+ return 0
1149
+
1150
+ #
1151
+
1152
+ def help_run(self):
1153
+ help = """\
1154
+ Usage: scons-time run [OPTIONS] [FILE ...]
1155
+
1156
+ --aegis=PROJECT Use SCons from the Aegis PROJECT
1157
+ --chdir=DIR Name of unpacked directory for chdir
1158
+ -f FILE, --file=FILE Read configuration from specified FILE
1159
+ -h, --help Print this help and exit
1160
+ -n, --no-exec No execute, just print command lines
1161
+ --number=NUMBER Put output in files for run NUMBER
1162
+ --outdir=OUTDIR Put output files in OUTDIR
1163
+ -p STRING, --prefix=STRING Use STRING as log file/profile prefix
1164
+ --python=PYTHON Time using the specified PYTHON
1165
+ -q, --quiet Don't print command lines
1166
+ --scons=SCONS Time using the specified SCONS
1167
+ --svn=URL, --subversion=URL Use SCons from Subversion URL
1168
+ -v, --verbose Display output of commands
1169
+ """
1170
+ sys.stdout.write(self.outdent(help))
1171
+ sys.stdout.flush()
1172
+
1173
+ def do_run(self, argv):
1174
+ """
1175
+ """
1176
+ run_number_list = [None]
1177
+
1178
+ short_opts = '?f:hnp:qs:v'
1179
+
1180
+ long_opts = [
1181
+ 'aegis=',
1182
+ 'file=',
1183
+ 'help',
1184
+ 'no-exec',
1185
+ 'number=',
1186
+ 'outdir=',
1187
+ 'prefix=',
1188
+ 'python=',
1189
+ 'quiet',
1190
+ 'scons=',
1191
+ 'svn=',
1192
+ 'subdir=',
1193
+ 'subversion=',
1194
+ 'verbose',
1195
+ ]
1196
+
1197
+ opts, args = getopt.getopt(argv[1:], short_opts, long_opts)
1198
+
1199
+ for o, a in opts:
1200
+ if o in ('--aegis',):
1201
+ self.aegis_project = a
1202
+ elif o in ('-f', '--file'):
1203
+ self.config_file = a
1204
+ elif o in ('-?', '-h', '--help'):
1205
+ self.do_help(['help', 'run'])
1206
+ sys.exit(0)
1207
+ elif o in ('-n', '--no-exec'):
1208
+ self.execute = self._do_not_execute
1209
+ elif o in ('--number',):
1210
+ run_number_list = self.split_run_numbers(a)
1211
+ elif o in ('--outdir',):
1212
+ self.outdir = a
1213
+ elif o in ('-p', '--prefix'):
1214
+ self.prefix = a
1215
+ elif o in ('--python',):
1216
+ self.python = a
1217
+ elif o in ('-q', '--quiet'):
1218
+ self.display = self._do_not_display
1219
+ elif o in ('-s', '--subdir'):
1220
+ self.subdir = a
1221
+ elif o in ('--scons',):
1222
+ self.scons = a
1223
+ elif o in ('--svn', '--subversion'):
1224
+ self.subversion_url = a
1225
+ elif o in ('-v', '--verbose'):
1226
+ self.redirect = tee_to_file
1227
+ self.verbose = True
1228
+ self.svn_co_flag = ''
1229
+
1230
+ if not args and not self.config_file:
1231
+ sys.stderr.write('%s: run: No arguments or -f config file specified.\n' % self.name)
1232
+ sys.stderr.write('%s Type "%s help run" for help.\n' % (self.name_spaces, self.name))
1233
+ sys.exit(1)
1234
+
1235
+ if self.config_file:
1236
+ exec open(self.config_file, 'rU').read() in self.__dict__
1237
+
1238
+ if args:
1239
+ self.archive_list = args
1240
+
1241
+ archive_file_name = os.path.split(self.archive_list[0])[1]
1242
+
1243
+ if not self.subdir:
1244
+ self.subdir = self.archive_splitext(archive_file_name)[0]
1245
+
1246
+ if not self.prefix:
1247
+ self.prefix = self.archive_splitext(archive_file_name)[0]
1248
+
1249
+ prepare = None
1250
+ if self.subversion_url:
1251
+ prepare = self.prep_subversion_run
1252
+ elif self.aegis_project:
1253
+ prepare = self.prep_aegis_run
1254
+
1255
+ for run_number in run_number_list:
1256
+ self.individual_run(run_number, self.archive_list, prepare)
1257
+
1258
+ def split_run_numbers(self, s):
1259
+ result = []
1260
+ for n in s.split(','):
1261
+ try:
1262
+ x, y = n.split('-')
1263
+ except ValueError:
1264
+ result.append(int(n))
1265
+ else:
1266
+ result.extend(list(range(int(x), int(y)+1)))
1267
+ return result
1268
+
1269
+ def scons_path(self, dir):
1270
+ return os.path.join(dir, 'src', 'script', 'scons.py')
1271
+
1272
+ def scons_lib_dir_path(self, dir):
1273
+ return os.path.join(dir, 'src', 'engine')
1274
+
1275
+ def prep_aegis_run(self, commands, removals):
1276
+ self.aegis_tmpdir = make_temp_file(prefix = self.name + '-aegis-')
1277
+ removals.append((shutil.rmtree, 'rm -rf %%s', self.aegis_tmpdir))
1278
+
1279
+ self.aegis_parent_project = os.path.splitext(self.aegis_project)[0]
1280
+ self.scons = self.scons_path(self.aegis_tmpdir)
1281
+ self.scons_lib_dir = self.scons_lib_dir_path(self.aegis_tmpdir)
1282
+
1283
+ commands.extend([
1284
+ 'mkdir %(aegis_tmpdir)s',
1285
+ (lambda: os.chdir(self.aegis_tmpdir), 'cd %(aegis_tmpdir)s'),
1286
+ '%(aegis)s -cp -ind -p %(aegis_parent_project)s .',
1287
+ '%(aegis)s -cp -ind -p %(aegis_project)s -delta %(run_number)s .',
1288
+ ])
1289
+
1290
+ def prep_subversion_run(self, commands, removals):
1291
+ self.svn_tmpdir = make_temp_file(prefix = self.name + '-svn-')
1292
+ removals.append((shutil.rmtree, 'rm -rf %%s', self.svn_tmpdir))
1293
+
1294
+ self.scons = self.scons_path(self.svn_tmpdir)
1295
+ self.scons_lib_dir = self.scons_lib_dir_path(self.svn_tmpdir)
1296
+
1297
+ commands.extend([
1298
+ 'mkdir %(svn_tmpdir)s',
1299
+ '%(svn)s co %(svn_co_flag)s -r %(run_number)s %(subversion_url)s %(svn_tmpdir)s',
1300
+ ])
1301
+
1302
+ def individual_run(self, run_number, archive_list, prepare=None):
1303
+ """
1304
+ Performs an individual run of the default SCons invocations.
1305
+ """
1306
+
1307
+ commands = []
1308
+ removals = []
1309
+
1310
+ if prepare:
1311
+ prepare(commands, removals)
1312
+
1313
+ save_scons = self.scons
1314
+ save_scons_wrapper = self.scons_wrapper
1315
+ save_scons_lib_dir = self.scons_lib_dir
1316
+
1317
+ if self.outdir is None:
1318
+ self.outdir = self.orig_cwd
1319
+ elif not os.path.isabs(self.outdir):
1320
+ self.outdir = os.path.join(self.orig_cwd, self.outdir)
1321
+
1322
+ if self.scons is None:
1323
+ self.scons = self.scons_path(self.orig_cwd)
1324
+
1325
+ if self.scons_lib_dir is None:
1326
+ self.scons_lib_dir = self.scons_lib_dir_path(self.orig_cwd)
1327
+
1328
+ if self.scons_wrapper is None:
1329
+ self.scons_wrapper = self.scons
1330
+
1331
+ if not run_number:
1332
+ run_number = self.find_next_run_number(self.outdir, self.prefix)
1333
+
1334
+ self.run_number = str(run_number)
1335
+
1336
+ self.prefix_run = self.prefix + '-%03d' % run_number
1337
+
1338
+ if self.targets0 is None:
1339
+ self.targets0 = self.startup_targets
1340
+ if self.targets1 is None:
1341
+ self.targets1 = self.targets
1342
+ if self.targets2 is None:
1343
+ self.targets2 = self.targets
1344
+
1345
+ self.tmpdir = make_temp_file(prefix = self.name + '-')
1346
+
1347
+ commands.extend([
1348
+ 'mkdir %(tmpdir)s',
1349
+
1350
+ (os.chdir, 'cd %%s', self.tmpdir),
1351
+ ])
1352
+
1353
+ for archive in archive_list:
1354
+ if not os.path.isabs(archive):
1355
+ archive = os.path.join(self.orig_cwd, archive)
1356
+ if os.path.isdir(archive):
1357
+ dest = os.path.split(archive)[1]
1358
+ commands.append((shutil.copytree, 'cp -r %%s %%s', archive, dest))
1359
+ else:
1360
+ suffix = self.archive_splitext(archive)[1]
1361
+ unpack_command = self.unpack_map.get(suffix)
1362
+ if not unpack_command:
1363
+ dest = os.path.split(archive)[1]
1364
+ commands.append((shutil.copyfile, 'cp %%s %%s', archive, dest))
1365
+ else:
1366
+ commands.append(unpack_command + (archive,))
1367
+
1368
+ commands.extend([
1369
+ (os.chdir, 'cd %%s', self.subdir),
1370
+ ])
1371
+
1372
+ commands.extend(self.initial_commands)
1373
+
1374
+ commands.extend([
1375
+ (lambda: read_tree('.'),
1376
+ 'find * -type f | xargs cat > /dev/null'),
1377
+
1378
+ (self.set_env, 'export %%s=%%s',
1379
+ 'SCONS_LIB_DIR', self.scons_lib_dir),
1380
+
1381
+ '%(python)s %(scons_wrapper)s --version',
1382
+ ])
1383
+
1384
+ index = 0
1385
+ for run_command in self.run_commands:
1386
+ setattr(self, 'prof%d' % index, self.profile_name(index))
1387
+ c = (
1388
+ self.log_execute,
1389
+ self.log_display,
1390
+ run_command,
1391
+ self.logfile_name(index),
1392
+ )
1393
+ commands.append(c)
1394
+ index = index + 1
1395
+
1396
+ commands.extend([
1397
+ (os.chdir, 'cd %%s', self.orig_cwd),
1398
+ ])
1399
+
1400
+ if not os.environ.get('PRESERVE'):
1401
+ commands.extend(removals)
1402
+
1403
+ commands.append((shutil.rmtree, 'rm -rf %%s', self.tmpdir))
1404
+
1405
+ self.run_command_list(commands, self.__dict__)
1406
+
1407
+ self.scons = save_scons
1408
+ self.scons_lib_dir = save_scons_lib_dir
1409
+ self.scons_wrapper = save_scons_wrapper
1410
+
1411
+ #
1412
+
1413
+ def help_time(self):
1414
+ help = """\
1415
+ Usage: scons-time time [OPTIONS] FILE [...]
1416
+
1417
+ -C DIR, --chdir=DIR Change to DIR before looking for files
1418
+ -f FILE, --file=FILE Read configuration from specified FILE
1419
+ --fmt=FORMAT, --format=FORMAT Print data in specified FORMAT
1420
+ -h, --help Print this help and exit
1421
+ -p STRING, --prefix=STRING Use STRING as log file/profile prefix
1422
+ -t NUMBER, --tail=NUMBER Only report the last NUMBER files
1423
+ --which=TIMER Plot timings for TIMER: total,
1424
+ SConscripts, SCons, commands.
1425
+ """
1426
+ sys.stdout.write(self.outdent(help))
1427
+ sys.stdout.flush()
1428
+
1429
+ def do_time(self, argv):
1430
+
1431
+ format = 'ascii'
1432
+ logfile_path = lambda x: x
1433
+ tail = None
1434
+ which = 'total'
1435
+
1436
+ short_opts = '?C:f:hp:t:'
1437
+
1438
+ long_opts = [
1439
+ 'chdir=',
1440
+ 'file=',
1441
+ 'fmt=',
1442
+ 'format=',
1443
+ 'help',
1444
+ 'prefix=',
1445
+ 'tail=',
1446
+ 'title=',
1447
+ 'which=',
1448
+ ]
1449
+
1450
+ opts, args = getopt.getopt(argv[1:], short_opts, long_opts)
1451
+
1452
+ for o, a in opts:
1453
+ if o in ('-C', '--chdir'):
1454
+ self.chdir = a
1455
+ elif o in ('-f', '--file'):
1456
+ self.config_file = a
1457
+ elif o in ('--fmt', '--format'):
1458
+ format = a
1459
+ elif o in ('-?', '-h', '--help'):
1460
+ self.do_help(['help', 'time'])
1461
+ sys.exit(0)
1462
+ elif o in ('-p', '--prefix'):
1463
+ self.prefix = a
1464
+ elif o in ('-t', '--tail'):
1465
+ tail = int(a)
1466
+ elif o in ('--title',):
1467
+ self.title = a
1468
+ elif o in ('--which',):
1469
+ if not a in self.time_strings.keys():
1470
+ sys.stderr.write('%s: time: Unrecognized timer "%s".\n' % (self.name, a))
1471
+ sys.stderr.write('%s Type "%s help time" for help.\n' % (self.name_spaces, self.name))
1472
+ sys.exit(1)
1473
+ which = a
1474
+
1475
+ if self.config_file:
1476
+ HACK_for_exec(open(self.config_file, 'rU').read(), self.__dict__)
1477
+
1478
+ if self.chdir:
1479
+ os.chdir(self.chdir)
1480
+ logfile_path = lambda x: os.path.join(self.chdir, x)
1481
+
1482
+ if not args:
1483
+
1484
+ pattern = '%s*.log' % self.prefix
1485
+ args = self.args_to_files([pattern], tail)
1486
+
1487
+ if not args:
1488
+ if self.chdir:
1489
+ directory = self.chdir
1490
+ else:
1491
+ directory = os.getcwd()
1492
+
1493
+ sys.stderr.write('%s: time: No arguments specified.\n' % self.name)
1494
+ sys.stderr.write('%s No %s*.log files found in "%s".\n' % (self.name_spaces, self.prefix, directory))
1495
+ sys.stderr.write('%s Type "%s help time" for help.\n' % (self.name_spaces, self.name))
1496
+ sys.exit(1)
1497
+
1498
+ else:
1499
+
1500
+ args = self.args_to_files(args, tail)
1501
+
1502
+ cwd_ = os.getcwd() + os.sep
1503
+
1504
+ if format == 'ascii':
1505
+
1506
+ columns = ("Total", "SConscripts", "SCons", "commands")
1507
+ self.ascii_table(args, columns, self.get_debug_times, logfile_path)
1508
+
1509
+ elif format == 'gnuplot':
1510
+
1511
+ results = self.collect_results(args, self.get_debug_times,
1512
+ self.time_strings[which])
1513
+
1514
+ self.gnuplot_results(results, fmt='%s %.6f')
1515
+
1516
+ else:
1517
+
1518
+ sys.stderr.write('%s: time: Unknown format "%s".\n' % (self.name, format))
1519
+ sys.exit(1)
1520
+
1521
+ if __name__ == '__main__':
1522
+ opts, args = getopt.getopt(sys.argv[1:], 'h?V', ['help', 'version'])
1523
+
1524
+ ST = SConsTimer()
1525
+
1526
+ for o, a in opts:
1527
+ if o in ('-?', '-h', '--help'):
1528
+ ST.do_help(['help'])
1529
+ sys.exit(0)
1530
+ elif o in ('-V', '--version'):
1531
+ sys.stdout.write('scons-time version\n')
1532
+ sys.exit(0)
1533
+
1534
+ if not args:
1535
+ sys.stderr.write('Type "%s help" for usage.\n' % ST.name)
1536
+ sys.exit(1)
1537
+
1538
+ ST.execute_subcommand(args)
1539
+
1540
+ # Local Variables:
1541
+ # tab-width:4
1542
+ # indent-tabs-mode:nil
1543
+ # End:
1544
+ # vim: set expandtab tabstop=4 shiftwidth=4: