exercism-analysis 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/exercism-analysis.gemspec +30 -0
- data/lib/exercism-analysis.rb +38 -0
- data/lib/exercism-analysis/adapters/adapter.rb +23 -0
- data/lib/exercism-analysis/adapters/clojure.rb +13 -0
- data/lib/exercism-analysis/adapters/go.rb +19 -0
- data/lib/exercism-analysis/adapters/javascript.rb +13 -0
- data/lib/exercism-analysis/adapters/python.rb +13 -0
- data/lib/exercism-analysis/adapters/ruby.rb +19 -0
- data/lib/exercism-analysis/analysis.rb +18 -0
- data/lib/exercism-analysis/analyzers/analyzer.rb +54 -0
- data/lib/exercism-analysis/analyzers/clojure/kibit.rb +25 -0
- data/lib/exercism-analysis/analyzers/go/golint.rb +23 -0
- data/lib/exercism-analysis/analyzers/javascript/jslint.rb +24 -0
- data/lib/exercism-analysis/analyzers/python/pylint.rb +24 -0
- data/lib/exercism-analysis/analyzers/ruby/control_flow.rb +21 -0
- data/lib/exercism-analysis/analyzers/ruby/enumerable_condition.rb +21 -0
- data/lib/exercism-analysis/analyzers/ruby/for_loop.rb +29 -0
- data/lib/exercism-analysis/analyzers/ruby/indentation.rb +21 -0
- data/lib/exercism-analysis/analyzers/ruby/iter_mutation.rb +37 -0
- data/lib/exercism-analysis/analyzers/ruby/output.rb +20 -0
- data/lib/exercism-analysis/analyzers/ruby/range.rb +28 -0
- data/lib/exercism-analysis/analyzers/ruby/roodi.rb +19 -0
- data/lib/exercism-analysis/analyzers/ruby/send.rb +25 -0
- data/lib/exercism-analysis/analyzers/ruby/shebang.rb +23 -0
- data/lib/exercism-analysis/analyzers/ruby/tab.rb +38 -0
- data/lib/exercism-analysis/processors/call_processor.rb +39 -0
- data/lib/exercism-analysis/processors/control_flow_processor.rb +27 -0
- data/lib/exercism-analysis/processors/enumerable_condition_processor.rb +31 -0
- data/lib/exercism-analysis/processors/for_loop_processor.rb +21 -0
- data/lib/exercism-analysis/processors/indentation_processor.rb +69 -0
- data/lib/exercism-analysis/processors/iter_mutation_processor.rb +50 -0
- data/lib/exercism-analysis/processors/processor.rb +34 -0
- data/lib/exercism-analysis/processors/range_processor.rb +23 -0
- data/lib/exercism-analysis/processors/send_processor.rb +23 -0
- data/lib/exercism-analysis/templates/each_to_map.rb +29 -0
- data/lib/exercism-analysis/templates/each_to_select.rb +31 -0
- data/lib/exercism-analysis/templates/range_exclusive.rb +19 -0
- data/lib/exercism-analysis/templates/template.rb +29 -0
- data/vendor/clojure/kibit-runner/LICENSE +214 -0
- data/vendor/clojure/kibit-runner/project.clj +10 -0
- data/vendor/clojure/kibit-runner/src/kibit_runner/core.clj +17 -0
- data/vendor/clojure/kibit-runner/target/kibit-runner-0.1.0-SNAPSHOT-standalone.jar +0 -0
- data/vendor/clojure/kibit-runner/target/kibit-runner-0.1.0-SNAPSHOT.jar +0 -0
- data/vendor/clojure/kibit-runner/target/stale/extract-native.dependencies +1 -0
- data/vendor/go/src/github.com/golang/lint/LICENSE +27 -0
- data/vendor/go/src/github.com/golang/lint/README +59 -0
- data/vendor/go/src/github.com/golang/lint/golint/golint.go +67 -0
- data/vendor/go/src/github.com/golang/lint/lint.go +1061 -0
- data/vendor/go/src/runner/golint_runner.go +23 -0
- data/vendor/javascript/jshint_runner.js +6 -0
- data/vendor/javascript/node_modules/jshint/README.md +47 -0
- data/vendor/javascript/node_modules/jshint/bin/apply +6 -0
- data/vendor/javascript/node_modules/jshint/bin/build +36 -0
- data/vendor/javascript/node_modules/jshint/bin/changelog +36 -0
- data/vendor/javascript/node_modules/jshint/bin/jshint +3 -0
- data/vendor/javascript/node_modules/jshint/bin/land +34 -0
- data/vendor/javascript/node_modules/jshint/data/ascii-identifier-data.js +22 -0
- data/vendor/javascript/node_modules/jshint/data/non-ascii-identifier-part-only.js +1570 -0
- data/vendor/javascript/node_modules/jshint/data/non-ascii-identifier-start.js +48477 -0
- data/vendor/javascript/node_modules/jshint/dist/jshint-rhino.js +60642 -0
- data/vendor/javascript/node_modules/jshint/dist/jshint.js +60525 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/README.md +196 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/cli.js +1139 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/cat.js +17 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/command.js +16 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/echo.js +54 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/glob.js +6 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/long_desc.js +20 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/progress.js +11 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/sort.js +18 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/spinner.js +9 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/static.coffee +27 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/static.js +25 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/index.js +1 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/LICENSE +27 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/README.md +250 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/examples/g.js +9 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/examples/usr-local.js +9 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/glob.js +728 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/LICENSE +16 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/README.md +42 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/inherits.js +1 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/inherits_browser.js +23 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/package.json +51 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/test.js +25 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/package.json +58 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/00-setup.js +176 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/bash-comparison.js +63 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/bash-results.json +351 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/cwd-test.js +55 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/globstar-match.js +19 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/mark.js +118 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/new-glob-optional-options.js +10 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/nocase-nomagic.js +113 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/pause-resume.js +73 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/readme-issue.js +36 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/root-nomount.js +39 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/root.js +46 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/stat.js +32 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/zz-cleanup.js +11 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/package.json +70 -0
- data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/LICENCE +19 -0
- data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/README.md +33 -0
- data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/index.js +86 -0
- data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/node_modules/date-now/LICENCE +19 -0
- data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/node_modules/date-now/README.md +45 -0
- data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/node_modules/date-now/index.js +5 -0
- data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/node_modules/date-now/package.json +89 -0
- data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/node_modules/date-now/seed.js +16 -0
- data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/node_modules/date-now/test/index.js +28 -0
- data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/node_modules/date-now/test/static/index.html +10 -0
- data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/package.json +88 -0
- data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/test/index.js +67 -0
- data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/test/static/index.html +12 -0
- data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/test/static/test-adapter.js +53 -0
- data/vendor/javascript/node_modules/jshint/node_modules/exit/Gruntfile.js +48 -0
- data/vendor/javascript/node_modules/jshint/node_modules/exit/LICENSE-MIT +22 -0
- data/vendor/javascript/node_modules/jshint/node_modules/exit/README.md +75 -0
- data/vendor/javascript/node_modules/jshint/node_modules/exit/lib/exit.js +41 -0
- data/vendor/javascript/node_modules/jshint/node_modules/exit/package.json +69 -0
- data/vendor/javascript/node_modules/jshint/node_modules/exit/test/exit_test.js +121 -0
- data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/10-stderr.txt +10 -0
- data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/10-stdout-stderr.txt +20 -0
- data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/10-stdout.txt +10 -0
- data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/100-stderr.txt +100 -0
- data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/100-stdout-stderr.txt +200 -0
- data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/100-stdout.txt +100 -0
- data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/1000-stderr.txt +1000 -0
- data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/1000-stdout-stderr.txt +2000 -0
- data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/1000-stdout.txt +1000 -0
- data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/create-files.sh +8 -0
- data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/log-broken.js +23 -0
- data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/log.js +25 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/LICENSE +18 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/README.md +83 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/lib/CollectingHandler.js +55 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/lib/FeedHandler.js +95 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/lib/Parser.js +337 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/lib/ProxyHandler.js +27 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/lib/Stream.js +35 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/lib/Tokenizer.js +891 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/lib/WritableStream.js +21 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/lib/index.js +68 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domelementtype/LICENSE +11 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domelementtype/index.js +14 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domelementtype/package.json +40 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domelementtype/readme.md +1 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/LICENSE +11 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/index.js +211 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/package.json +68 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/readme.md +102 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/01-basic.json +57 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/02-single_tag_1.json +21 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/03-single_tag_2.json +21 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/04-unescaped_in_script.json +27 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/05-tags_in_comment.json +18 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/06-comment_in_script.json +18 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/07-unescaped_in_style.json +20 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/08-extra_spaces_in_tag.json +20 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/09-unquoted_attrib.json +20 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/10-singular_attribute.json +15 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/11-text_outside_tags.json +40 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/12-text_only.json +11 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/13-comment_in_text.json +19 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/14-comment_in_text_in_script.json +18 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/15-non-verbose.json +22 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/16-normalize_whitespace.json +47 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/17-xml_namespace.json +18 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/18-enforce_empty_tags.json +16 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/19-ignore_empty_tags.json +20 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/20-template_script_tags.json +20 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/21-conditional_comments.json +15 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/22-lowercase_tags.json +41 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/23-dom-lvl1.json +121 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/tests.js +58 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/LICENSE +11 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/index.js +14 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/lib/helpers.js +141 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/lib/legacy.js +87 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/lib/manipulation.js +77 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/lib/querying.js +94 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/lib/stringify.js +93 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/lib/traversal.js +24 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/package.json +71 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/readme.md +1 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/test/fixture.js +6 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/test/tests/helpers.js +89 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/test/tests/legacy.js +119 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/test/utils.js +9 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/LICENSE +11 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/index.js +31 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/lib/decode.js +72 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/lib/decode_codepoint.js +26 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/lib/encode.js +48 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/maps/decode.json +1 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/maps/entities.json +1 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/maps/legacy.json +1 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/maps/xml.json +1 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/package.json +79 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/readme.md +31 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/test/mocha.opts +2 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/test/test.js +150 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/LICENSE +18 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/README.md +15 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/duplex.js +1 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/float.patch +923 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/lib/_stream_duplex.js +89 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/lib/_stream_passthrough.js +46 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/lib/_stream_readable.js +944 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/lib/_stream_transform.js +209 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/lib/_stream_writable.js +472 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/core-util-is/README.md +3 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/core-util-is/float.patch +604 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/core-util-is/lib/util.js +107 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/core-util-is/package.json +53 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/core-util-is/util.js +106 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/inherits/LICENSE +16 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/inherits/README.md +42 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/inherits/inherits.js +1 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/inherits/inherits_browser.js +23 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/inherits/package.json +51 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/inherits/test.js +25 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/isarray/README.md +54 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/isarray/build/build.js +209 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/isarray/component.json +19 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/isarray/index.js +3 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/isarray/package.json +54 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/string_decoder/LICENSE +20 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/string_decoder/README.md +7 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/string_decoder/index.js +200 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/string_decoder/package.json +53 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/package.json +68 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/passthrough.js +1 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/readable.js +7 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/transform.js +1 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/writable.js +1 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/package.json +90 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/01-events.js +9 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/02-stream.js +23 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/03-feed.js +19 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Documents/Atom_Example.xml +25 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Documents/Attributes.html +16 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Documents/Basic.html +1 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Documents/RDF_Example.xml +63 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Documents/RSS_Example.xml +48 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/01-simple.json +44 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/02-template.json +63 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/03-lowercase_tags.json +46 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/04-cdata.json +50 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/05-cdata-special.json +35 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/06-leading-lt.json +16 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/07-self-closing.json +67 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/08-implicit-close-tags.json +59 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/09-attributes.json +68 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/10-crazy-attrib.json +52 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/11-script_in_script.json +54 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/12-long-comment-end.json +20 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/13-long-cdata-end.json +22 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/14-implicit-open-tags.json +27 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/15-lt-whitespace.json +16 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/16-double_attribs.json +45 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/17-numeric_entities.json +16 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/18-legacy_entities.json +16 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/19-named_entities.json +16 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/20-xml_entities.json +16 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/21-entity_in_attribute.json +38 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/22-double_brackets.json +41 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/23-legacy_entity_fail.json +16 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/24-special_special.json +133 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/25-empty_tag_name.json +13 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/26-not-quite-closed.json +35 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/27-entities_in_attributes.json +62 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/28-cdata_in_html.json +9 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/29-comment_edge-cases.json +18 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/30-cdata_edge-cases.json +22 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Feeds/01-rss.js +34 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Feeds/02-atom.js +18 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Feeds/03-rdf.js +20 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Stream/01-basic.json +83 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Stream/02-RSS.json +1093 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Stream/03-Atom.json +644 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Stream/04-RDF.json +1399 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Stream/05-Attributes.json +354 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/api.js +63 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/test-helper.js +83 -0
- data/vendor/javascript/node_modules/jshint/node_modules/minimatch/LICENSE +23 -0
- data/vendor/javascript/node_modules/jshint/node_modules/minimatch/README.md +218 -0
- data/vendor/javascript/node_modules/jshint/node_modules/minimatch/minimatch.js +1061 -0
- data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/CONTRIBUTORS +14 -0
- data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/LICENSE +23 -0
- data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/README.md +97 -0
- data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js +252 -0
- data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/package.json +50 -0
- data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/test/basic.js +369 -0
- data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/test/foreach.js +52 -0
- data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js +50 -0
- data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/LICENSE +27 -0
- data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/README.md +53 -0
- data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/bench.js +283 -0
- data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/package.json +58 -0
- data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/sigmund.js +39 -0
- data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/test/basic.js +24 -0
- data/vendor/javascript/node_modules/jshint/node_modules/minimatch/package.json +57 -0
- data/vendor/javascript/node_modules/jshint/node_modules/minimatch/test/basic.js +399 -0
- data/vendor/javascript/node_modules/jshint/node_modules/minimatch/test/brace-expand.js +33 -0
- data/vendor/javascript/node_modules/jshint/node_modules/minimatch/test/caching.js +14 -0
- data/vendor/javascript/node_modules/jshint/node_modules/minimatch/test/defaults.js +274 -0
- data/vendor/javascript/node_modules/jshint/node_modules/minimatch/test/extglob-ending-with-state-char.js +8 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/LICENSE +26 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/README.md +569 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/bin/shjs +51 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/global.js +3 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/make.js +47 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/package.json +61 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/scripts/generate-docs.js +21 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/scripts/run-tests.js +50 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/shell.js +157 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/cat.js +43 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/cd.js +19 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/chmod.js +208 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/common.js +203 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/cp.js +201 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/dirs.js +191 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/echo.js +20 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/error.js +10 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/exec.js +181 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/find.js +51 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/grep.js +52 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/ln.js +53 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/ls.js +126 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/mkdir.js +68 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/mv.js +80 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/popd.js +1 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/pushd.js +1 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/pwd.js +11 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/rm.js +145 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/sed.js +43 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/tempdir.js +56 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/test.js +85 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/to.js +29 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/toEnd.js +29 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/which.js +83 -0
- data/vendor/javascript/node_modules/jshint/node_modules/strip-json-comments/cli.js +41 -0
- data/vendor/javascript/node_modules/jshint/node_modules/strip-json-comments/package.json +76 -0
- data/vendor/javascript/node_modules/jshint/node_modules/strip-json-comments/readme.md +74 -0
- data/vendor/javascript/node_modules/jshint/node_modules/strip-json-comments/strip-json-comments.js +64 -0
- data/vendor/javascript/node_modules/jshint/node_modules/underscore/LICENSE +23 -0
- data/vendor/javascript/node_modules/jshint/node_modules/underscore/README.md +22 -0
- data/vendor/javascript/node_modules/jshint/node_modules/underscore/package.json +66 -0
- data/vendor/javascript/node_modules/jshint/node_modules/underscore/underscore-min.js +6 -0
- data/vendor/javascript/node_modules/jshint/node_modules/underscore/underscore.js +1343 -0
- data/vendor/javascript/node_modules/jshint/package.json +80 -0
- data/vendor/javascript/node_modules/jshint/src/cli.js +731 -0
- data/vendor/javascript/node_modules/jshint/src/jshint.js +5023 -0
- data/vendor/javascript/node_modules/jshint/src/lex.js +1650 -0
- data/vendor/javascript/node_modules/jshint/src/messages.js +223 -0
- data/vendor/javascript/node_modules/jshint/src/platforms/rhino.js +115 -0
- data/vendor/javascript/node_modules/jshint/src/reg.js +38 -0
- data/vendor/javascript/node_modules/jshint/src/reporters/checkstyle.js +81 -0
- data/vendor/javascript/node_modules/jshint/src/reporters/default.js +34 -0
- data/vendor/javascript/node_modules/jshint/src/reporters/jslint_xml.js +57 -0
- data/vendor/javascript/node_modules/jshint/src/reporters/non_error.js +52 -0
- data/vendor/javascript/node_modules/jshint/src/state.js +28 -0
- data/vendor/javascript/node_modules/jshint/src/style.js +143 -0
- data/vendor/javascript/node_modules/jshint/src/vars.js +658 -0
- data/vendor/python/astroid/COPYING +339 -0
- data/vendor/python/astroid/COPYING.LESSER +510 -0
- data/vendor/python/astroid/ChangeLog +574 -0
- data/vendor/python/astroid/MANIFEST.in +9 -0
- data/vendor/python/astroid/README +56 -0
- data/vendor/python/astroid/README.Python3 +26 -0
- data/vendor/python/astroid/__init__.py +118 -0
- data/vendor/python/astroid/__init__.pyc +0 -0
- data/vendor/python/astroid/__pkginfo__.py +48 -0
- data/vendor/python/astroid/__pkginfo__.pyc +0 -0
- data/vendor/python/astroid/announce.txt +23 -0
- data/vendor/python/astroid/as_string.py +496 -0
- data/vendor/python/astroid/as_string.pyc +0 -0
- data/vendor/python/astroid/bases.py +618 -0
- data/vendor/python/astroid/bases.pyc +0 -0
- data/vendor/python/astroid/brain/py2gi.py +159 -0
- data/vendor/python/astroid/brain/py2gi.pyc +0 -0
- data/vendor/python/astroid/brain/py2mechanize.py +20 -0
- data/vendor/python/astroid/brain/py2mechanize.pyc +0 -0
- data/vendor/python/astroid/brain/py2qt4.py +25 -0
- data/vendor/python/astroid/brain/py2qt4.pyc +0 -0
- data/vendor/python/astroid/brain/py2stdlib.py +252 -0
- data/vendor/python/astroid/brain/py2stdlib.pyc +0 -0
- data/vendor/python/astroid/builder.py +238 -0
- data/vendor/python/astroid/builder.pyc +0 -0
- data/vendor/python/astroid/exceptions.py +51 -0
- data/vendor/python/astroid/exceptions.pyc +0 -0
- data/vendor/python/astroid/inference.py +393 -0
- data/vendor/python/astroid/inference.pyc +0 -0
- data/vendor/python/astroid/inspector.py +275 -0
- data/vendor/python/astroid/manager.py +336 -0
- data/vendor/python/astroid/manager.pyc +0 -0
- data/vendor/python/astroid/mixins.py +122 -0
- data/vendor/python/astroid/mixins.pyc +0 -0
- data/vendor/python/astroid/node_classes.py +928 -0
- data/vendor/python/astroid/node_classes.pyc +0 -0
- data/vendor/python/astroid/nodes.py +73 -0
- data/vendor/python/astroid/nodes.pyc +0 -0
- data/vendor/python/astroid/protocols.py +322 -0
- data/vendor/python/astroid/protocols.pyc +0 -0
- data/vendor/python/astroid/raw_building.py +361 -0
- data/vendor/python/astroid/raw_building.pyc +0 -0
- data/vendor/python/astroid/rebuilder.py +954 -0
- data/vendor/python/astroid/rebuilder.pyc +0 -0
- data/vendor/python/astroid/scoped_nodes.py +1118 -0
- data/vendor/python/astroid/scoped_nodes.pyc +0 -0
- data/vendor/python/astroid/setup.py +184 -0
- data/vendor/python/astroid/tox.ini +10 -0
- data/vendor/python/astroid/utils.py +236 -0
- data/vendor/python/astroid/utils.pyc +0 -0
- data/vendor/python/logilab/__init__.py +0 -0
- data/vendor/python/logilab/__init__.pyc +0 -0
- data/vendor/python/logilab/common/COPYING +339 -0
- data/vendor/python/logilab/common/COPYING.LESSER +510 -0
- data/vendor/python/logilab/common/ChangeLog +1517 -0
- data/vendor/python/logilab/common/MANIFEST.in +13 -0
- data/vendor/python/logilab/common/README +185 -0
- data/vendor/python/logilab/common/README.Python3 +29 -0
- data/vendor/python/logilab/common/__init__.py +171 -0
- data/vendor/python/logilab/common/__init__.pyc +0 -0
- data/vendor/python/logilab/common/__pkginfo__.py +53 -0
- data/vendor/python/logilab/common/__pkginfo__.pyc +0 -0
- data/vendor/python/logilab/common/announce.txt +25 -0
- data/vendor/python/logilab/common/bin/pytest +7 -0
- data/vendor/python/logilab/common/bin/pytest.bat +17 -0
- data/vendor/python/logilab/common/cache.py +114 -0
- data/vendor/python/logilab/common/changelog.py +236 -0
- data/vendor/python/logilab/common/changelog.pyc +0 -0
- data/vendor/python/logilab/common/clcommands.py +332 -0
- data/vendor/python/logilab/common/cli.py +208 -0
- data/vendor/python/logilab/common/compat.py +243 -0
- data/vendor/python/logilab/common/compat.pyc +0 -0
- data/vendor/python/logilab/common/configuration.py +1094 -0
- data/vendor/python/logilab/common/configuration.pyc +0 -0
- data/vendor/python/logilab/common/contexts.py +5 -0
- data/vendor/python/logilab/common/corbautils.py +117 -0
- data/vendor/python/logilab/common/daemon.py +100 -0
- data/vendor/python/logilab/common/date.py +333 -0
- data/vendor/python/logilab/common/dbf.py +229 -0
- data/vendor/python/logilab/common/debugger.py +210 -0
- data/vendor/python/logilab/common/decorators.py +281 -0
- data/vendor/python/logilab/common/decorators.pyc +0 -0
- data/vendor/python/logilab/common/deprecation.py +188 -0
- data/vendor/python/logilab/common/deprecation.pyc +0 -0
- data/vendor/python/logilab/common/fileutils.py +402 -0
- data/vendor/python/logilab/common/graph.py +276 -0
- data/vendor/python/logilab/common/graph.pyc +0 -0
- data/vendor/python/logilab/common/hg.py +130 -0
- data/vendor/python/logilab/common/interface.py +71 -0
- data/vendor/python/logilab/common/interface.pyc +0 -0
- data/vendor/python/logilab/common/logging_ext.py +193 -0
- data/vendor/python/logilab/common/modutils.py +695 -0
- data/vendor/python/logilab/common/modutils.pyc +0 -0
- data/vendor/python/logilab/common/optik_ext.py +391 -0
- data/vendor/python/logilab/common/optik_ext.pyc +0 -0
- data/vendor/python/logilab/common/optparser.py +90 -0
- data/vendor/python/logilab/common/proc.py +277 -0
- data/vendor/python/logilab/common/pyro_ext.py +180 -0
- data/vendor/python/logilab/common/pytest.py +1177 -0
- data/vendor/python/logilab/common/python-logilab-common.spec +184 -0
- data/vendor/python/logilab/common/registry.py +1113 -0
- data/vendor/python/logilab/common/setup.cfg +3 -0
- data/vendor/python/logilab/common/setup.py +189 -0
- data/vendor/python/logilab/common/shellutils.py +455 -0
- data/vendor/python/logilab/common/sphinx_ext.py +87 -0
- data/vendor/python/logilab/common/sphinxutils.py +122 -0
- data/vendor/python/logilab/common/table.py +925 -0
- data/vendor/python/logilab/common/tasksqueue.py +100 -0
- data/vendor/python/logilab/common/textutils.py +534 -0
- data/vendor/python/logilab/common/textutils.pyc +0 -0
- data/vendor/python/logilab/common/tree.py +369 -0
- data/vendor/python/logilab/common/tree.pyc +0 -0
- data/vendor/python/logilab/common/umessage.py +190 -0
- data/vendor/python/logilab/common/ureports/__init__.py +174 -0
- data/vendor/python/logilab/common/ureports/__init__.pyc +0 -0
- data/vendor/python/logilab/common/ureports/docbook_writer.py +139 -0
- data/vendor/python/logilab/common/ureports/html_writer.py +131 -0
- data/vendor/python/logilab/common/ureports/html_writer.pyc +0 -0
- data/vendor/python/logilab/common/ureports/nodes.py +201 -0
- data/vendor/python/logilab/common/ureports/nodes.pyc +0 -0
- data/vendor/python/logilab/common/ureports/text_writer.py +140 -0
- data/vendor/python/logilab/common/ureports/text_writer.pyc +0 -0
- data/vendor/python/logilab/common/urllib2ext.py +87 -0
- data/vendor/python/logilab/common/vcgutils.py +216 -0
- data/vendor/python/logilab/common/visitor.py +107 -0
- data/vendor/python/logilab/common/visitor.pyc +0 -0
- data/vendor/python/logilab/common/xmlrpcutils.py +131 -0
- data/vendor/python/logilab/common/xmlutils.py +61 -0
- data/vendor/python/pylint/CONTRIBUTORS.txt +38 -0
- data/vendor/python/pylint/COPYING +340 -0
- data/vendor/python/pylint/ChangeLog +1437 -0
- data/vendor/python/pylint/DEPENDS +3 -0
- data/vendor/python/pylint/MANIFEST.in +14 -0
- data/vendor/python/pylint/README +50 -0
- data/vendor/python/pylint/README.Python3 +37 -0
- data/vendor/python/pylint/__init__.py +44 -0
- data/vendor/python/pylint/__init__.pyc +0 -0
- data/vendor/python/pylint/__main__.py +3 -0
- data/vendor/python/pylint/__pkginfo__.py +74 -0
- data/vendor/python/pylint/__pkginfo__.pyc +0 -0
- data/vendor/python/pylint/bin/epylint +3 -0
- data/vendor/python/pylint/bin/epylint.bat +5 -0
- data/vendor/python/pylint/bin/pylint +3 -0
- data/vendor/python/pylint/bin/pylint-gui +3 -0
- data/vendor/python/pylint/bin/pylint-gui.bat +5 -0
- data/vendor/python/pylint/bin/pylint.bat +5 -0
- data/vendor/python/pylint/bin/pyreverse +3 -0
- data/vendor/python/pylint/bin/pyreverse.bat +5 -0
- data/vendor/python/pylint/bin/symilar +3 -0
- data/vendor/python/pylint/bin/symilar.bat +5 -0
- data/vendor/python/pylint/checkers/__init__.py +145 -0
- data/vendor/python/pylint/checkers/__init__.pyc +0 -0
- data/vendor/python/pylint/checkers/base.py +1141 -0
- data/vendor/python/pylint/checkers/base.pyc +0 -0
- data/vendor/python/pylint/checkers/classes.py +792 -0
- data/vendor/python/pylint/checkers/classes.pyc +0 -0
- data/vendor/python/pylint/checkers/design_analysis.py +367 -0
- data/vendor/python/pylint/checkers/design_analysis.pyc +0 -0
- data/vendor/python/pylint/checkers/exceptions.py +306 -0
- data/vendor/python/pylint/checkers/exceptions.pyc +0 -0
- data/vendor/python/pylint/checkers/format.py +943 -0
- data/vendor/python/pylint/checkers/format.pyc +0 -0
- data/vendor/python/pylint/checkers/imports.py +394 -0
- data/vendor/python/pylint/checkers/imports.pyc +0 -0
- data/vendor/python/pylint/checkers/logging.py +213 -0
- data/vendor/python/pylint/checkers/logging.pyc +0 -0
- data/vendor/python/pylint/checkers/misc.py +90 -0
- data/vendor/python/pylint/checkers/misc.pyc +0 -0
- data/vendor/python/pylint/checkers/newstyle.py +151 -0
- data/vendor/python/pylint/checkers/newstyle.pyc +0 -0
- data/vendor/python/pylint/checkers/raw_metrics.py +129 -0
- data/vendor/python/pylint/checkers/raw_metrics.pyc +0 -0
- data/vendor/python/pylint/checkers/similar.py +365 -0
- data/vendor/python/pylint/checkers/similar.pyc +0 -0
- data/vendor/python/pylint/checkers/stdlib.py +69 -0
- data/vendor/python/pylint/checkers/stdlib.pyc +0 -0
- data/vendor/python/pylint/checkers/strings.py +304 -0
- data/vendor/python/pylint/checkers/strings.pyc +0 -0
- data/vendor/python/pylint/checkers/typecheck.py +451 -0
- data/vendor/python/pylint/checkers/typecheck.pyc +0 -0
- data/vendor/python/pylint/checkers/utils.py +416 -0
- data/vendor/python/pylint/checkers/utils.pyc +0 -0
- data/vendor/python/pylint/checkers/variables.py +741 -0
- data/vendor/python/pylint/checkers/variables.pyc +0 -0
- data/vendor/python/pylint/config.py +156 -0
- data/vendor/python/pylint/config.pyc +0 -0
- data/vendor/python/pylint/epylint.py +175 -0
- data/vendor/python/pylint/gui.py +508 -0
- data/vendor/python/pylint/interfaces.py +72 -0
- data/vendor/python/pylint/interfaces.pyc +0 -0
- data/vendor/python/pylint/lint.py +1106 -0
- data/vendor/python/pylint/lint.pyc +0 -0
- data/vendor/python/pylint/pyreverse/__init__.py +5 -0
- data/vendor/python/pylint/pyreverse/diadefslib.py +233 -0
- data/vendor/python/pylint/pyreverse/diagrams.py +247 -0
- data/vendor/python/pylint/pyreverse/main.py +124 -0
- data/vendor/python/pylint/pyreverse/utils.py +131 -0
- data/vendor/python/pylint/pyreverse/writer.py +199 -0
- data/vendor/python/pylint/reporters/__init__.py +138 -0
- data/vendor/python/pylint/reporters/__init__.pyc +0 -0
- data/vendor/python/pylint/reporters/guireporter.py +28 -0
- data/vendor/python/pylint/reporters/guireporter.pyc +0 -0
- data/vendor/python/pylint/reporters/html.py +70 -0
- data/vendor/python/pylint/reporters/html.pyc +0 -0
- data/vendor/python/pylint/reporters/text.py +143 -0
- data/vendor/python/pylint/reporters/text.pyc +0 -0
- data/vendor/python/pylint/setup.cfg +3 -0
- data/vendor/python/pylint/setup.py +203 -0
- data/vendor/python/pylint/tox.ini +10 -0
- data/vendor/python/pylint/utils.py +744 -0
- data/vendor/python/pylint/utils.pyc +0 -0
- data/vendor/python/pylint_runner.py +22 -0
- metadata +675 -0
Binary file
|
@@ -0,0 +1,25 @@
|
|
1
|
+
I'm pleased to announce the %(VERSION)s release of %(DISTNAME)s.
|
2
|
+
|
3
|
+
What's new ?
|
4
|
+
------------
|
5
|
+
%(CHANGELOG)s
|
6
|
+
|
7
|
+
|
8
|
+
What is %(DISTNAME)s ?
|
9
|
+
------------------------
|
10
|
+
%(LONG_DESC)s
|
11
|
+
|
12
|
+
|
13
|
+
Home page
|
14
|
+
---------
|
15
|
+
%(WEB)s
|
16
|
+
|
17
|
+
Download
|
18
|
+
--------
|
19
|
+
%(FTP)s
|
20
|
+
|
21
|
+
Mailing list
|
22
|
+
------------
|
23
|
+
%(MAILINGLIST)s
|
24
|
+
|
25
|
+
%(ADDITIONAL_DESCR)s
|
@@ -0,0 +1,17 @@
|
|
1
|
+
@echo off
|
2
|
+
rem = """-*-Python-*- script
|
3
|
+
rem -------------------- DOS section --------------------
|
4
|
+
rem You could set PYTHONPATH or TK environment variables here
|
5
|
+
python -x "%~f0" %*
|
6
|
+
goto exit
|
7
|
+
|
8
|
+
"""
|
9
|
+
# -------------------- Python section --------------------
|
10
|
+
from logilab.common.pytest import run
|
11
|
+
run()
|
12
|
+
|
13
|
+
DosExitLabel = """
|
14
|
+
:exit
|
15
|
+
rem """
|
16
|
+
|
17
|
+
|
@@ -0,0 +1,114 @@
|
|
1
|
+
# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
|
2
|
+
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
|
3
|
+
#
|
4
|
+
# This file is part of logilab-common.
|
5
|
+
#
|
6
|
+
# logilab-common is free software: you can redistribute it and/or modify it under
|
7
|
+
# the terms of the GNU Lesser General Public License as published by the Free
|
8
|
+
# Software Foundation, either version 2.1 of the License, or (at your option) any
|
9
|
+
# later version.
|
10
|
+
#
|
11
|
+
# logilab-common is distributed in the hope that it will be useful, but WITHOUT
|
12
|
+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
13
|
+
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
14
|
+
# details.
|
15
|
+
#
|
16
|
+
# You should have received a copy of the GNU Lesser General Public License along
|
17
|
+
# with logilab-common. If not, see <http://www.gnu.org/licenses/>.
|
18
|
+
"""Cache module, with a least recently used algorithm for the management of the
|
19
|
+
deletion of entries.
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
"""
|
25
|
+
__docformat__ = "restructuredtext en"
|
26
|
+
|
27
|
+
from threading import Lock
|
28
|
+
|
29
|
+
from logilab.common.decorators import locked
|
30
|
+
|
31
|
+
_marker = object()
|
32
|
+
|
33
|
+
class Cache(dict):
|
34
|
+
"""A dictionary like cache.
|
35
|
+
|
36
|
+
inv:
|
37
|
+
len(self._usage) <= self.size
|
38
|
+
len(self.data) <= self.size
|
39
|
+
"""
|
40
|
+
|
41
|
+
def __init__(self, size=100):
|
42
|
+
""" Warning : Cache.__init__() != dict.__init__().
|
43
|
+
Constructor does not take any arguments beside size.
|
44
|
+
"""
|
45
|
+
assert size >= 0, 'cache size must be >= 0 (0 meaning no caching)'
|
46
|
+
self.size = size
|
47
|
+
self._usage = []
|
48
|
+
self._lock = Lock()
|
49
|
+
super(Cache, self).__init__()
|
50
|
+
|
51
|
+
def _acquire(self):
|
52
|
+
self._lock.acquire()
|
53
|
+
|
54
|
+
def _release(self):
|
55
|
+
self._lock.release()
|
56
|
+
|
57
|
+
def _update_usage(self, key):
|
58
|
+
if not self._usage:
|
59
|
+
self._usage.append(key)
|
60
|
+
elif self._usage[-1] != key:
|
61
|
+
try:
|
62
|
+
self._usage.remove(key)
|
63
|
+
except ValueError:
|
64
|
+
# we are inserting a new key
|
65
|
+
# check the size of the dictionary
|
66
|
+
# and remove the oldest item in the cache
|
67
|
+
if self.size and len(self._usage) >= self.size:
|
68
|
+
super(Cache, self).__delitem__(self._usage[0])
|
69
|
+
del self._usage[0]
|
70
|
+
self._usage.append(key)
|
71
|
+
else:
|
72
|
+
pass # key is already the most recently used key
|
73
|
+
|
74
|
+
def __getitem__(self, key):
|
75
|
+
value = super(Cache, self).__getitem__(key)
|
76
|
+
self._update_usage(key)
|
77
|
+
return value
|
78
|
+
__getitem__ = locked(_acquire, _release)(__getitem__)
|
79
|
+
|
80
|
+
def __setitem__(self, key, item):
|
81
|
+
# Just make sure that size > 0 before inserting a new item in the cache
|
82
|
+
if self.size > 0:
|
83
|
+
super(Cache, self).__setitem__(key, item)
|
84
|
+
self._update_usage(key)
|
85
|
+
__setitem__ = locked(_acquire, _release)(__setitem__)
|
86
|
+
|
87
|
+
def __delitem__(self, key):
|
88
|
+
super(Cache, self).__delitem__(key)
|
89
|
+
self._usage.remove(key)
|
90
|
+
__delitem__ = locked(_acquire, _release)(__delitem__)
|
91
|
+
|
92
|
+
def clear(self):
|
93
|
+
super(Cache, self).clear()
|
94
|
+
self._usage = []
|
95
|
+
clear = locked(_acquire, _release)(clear)
|
96
|
+
|
97
|
+
def pop(self, key, default=_marker):
|
98
|
+
if key in self:
|
99
|
+
self._usage.remove(key)
|
100
|
+
#if default is _marker:
|
101
|
+
# return super(Cache, self).pop(key)
|
102
|
+
return super(Cache, self).pop(key, default)
|
103
|
+
pop = locked(_acquire, _release)(pop)
|
104
|
+
|
105
|
+
def popitem(self):
|
106
|
+
raise NotImplementedError()
|
107
|
+
|
108
|
+
def setdefault(self, key, default=None):
|
109
|
+
raise NotImplementedError()
|
110
|
+
|
111
|
+
def update(self, other):
|
112
|
+
raise NotImplementedError()
|
113
|
+
|
114
|
+
|
@@ -0,0 +1,236 @@
|
|
1
|
+
# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
|
2
|
+
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
|
3
|
+
#
|
4
|
+
# This file is part of logilab-common.
|
5
|
+
#
|
6
|
+
# logilab-common is free software: you can redistribute it and/or modify it under
|
7
|
+
# the terms of the GNU Lesser General Public License as published by the Free
|
8
|
+
# Software Foundation, either version 2.1 of the License, or (at your option) any
|
9
|
+
# later version.
|
10
|
+
#
|
11
|
+
# logilab-common is distributed in the hope that it will be useful, but WITHOUT
|
12
|
+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
13
|
+
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
14
|
+
# details.
|
15
|
+
#
|
16
|
+
# You should have received a copy of the GNU Lesser General Public License along
|
17
|
+
# with logilab-common. If not, see <http://www.gnu.org/licenses/>.
|
18
|
+
"""Manipulation of upstream change log files.
|
19
|
+
|
20
|
+
The upstream change log files format handled is simpler than the one
|
21
|
+
often used such as those generated by the default Emacs changelog mode.
|
22
|
+
|
23
|
+
Sample ChangeLog format::
|
24
|
+
|
25
|
+
Change log for project Yoo
|
26
|
+
==========================
|
27
|
+
|
28
|
+
--
|
29
|
+
* add a new functionality
|
30
|
+
|
31
|
+
2002-02-01 -- 0.1.1
|
32
|
+
* fix bug #435454
|
33
|
+
* fix bug #434356
|
34
|
+
|
35
|
+
2002-01-01 -- 0.1
|
36
|
+
* initial release
|
37
|
+
|
38
|
+
|
39
|
+
There is 3 entries in this change log, one for each released version and one
|
40
|
+
for the next version (i.e. the current entry).
|
41
|
+
Each entry contains a set of messages corresponding to changes done in this
|
42
|
+
release.
|
43
|
+
All the non empty lines before the first entry are considered as the change
|
44
|
+
log title.
|
45
|
+
"""
|
46
|
+
|
47
|
+
__docformat__ = "restructuredtext en"
|
48
|
+
|
49
|
+
import sys
|
50
|
+
from stat import S_IWRITE
|
51
|
+
|
52
|
+
BULLET = '*'
|
53
|
+
SUBBULLET = '-'
|
54
|
+
INDENT = ' ' * 4
|
55
|
+
|
56
|
+
class NoEntry(Exception):
|
57
|
+
"""raised when we are unable to find an entry"""
|
58
|
+
|
59
|
+
class EntryNotFound(Exception):
|
60
|
+
"""raised when we are unable to find a given entry"""
|
61
|
+
|
62
|
+
class Version(tuple):
|
63
|
+
"""simple class to handle soft version number has a tuple while
|
64
|
+
correctly printing it as X.Y.Z
|
65
|
+
"""
|
66
|
+
def __new__(cls, versionstr):
|
67
|
+
if isinstance(versionstr, basestring):
|
68
|
+
versionstr = versionstr.strip(' :') # XXX (syt) duh?
|
69
|
+
parsed = cls.parse(versionstr)
|
70
|
+
else:
|
71
|
+
parsed = versionstr
|
72
|
+
return tuple.__new__(cls, parsed)
|
73
|
+
|
74
|
+
@classmethod
|
75
|
+
def parse(cls, versionstr):
|
76
|
+
versionstr = versionstr.strip(' :')
|
77
|
+
try:
|
78
|
+
return [int(i) for i in versionstr.split('.')]
|
79
|
+
except ValueError, ex:
|
80
|
+
raise ValueError("invalid literal for version '%s' (%s)"%(versionstr, ex))
|
81
|
+
|
82
|
+
def __str__(self):
|
83
|
+
return '.'.join([str(i) for i in self])
|
84
|
+
|
85
|
+
# upstream change log #########################################################
|
86
|
+
|
87
|
+
class ChangeLogEntry(object):
|
88
|
+
"""a change log entry, i.e. a set of messages associated to a version and
|
89
|
+
its release date
|
90
|
+
"""
|
91
|
+
version_class = Version
|
92
|
+
|
93
|
+
def __init__(self, date=None, version=None, **kwargs):
|
94
|
+
self.__dict__.update(kwargs)
|
95
|
+
if version:
|
96
|
+
self.version = self.version_class(version)
|
97
|
+
else:
|
98
|
+
self.version = None
|
99
|
+
self.date = date
|
100
|
+
self.messages = []
|
101
|
+
|
102
|
+
def add_message(self, msg):
|
103
|
+
"""add a new message"""
|
104
|
+
self.messages.append(([msg], []))
|
105
|
+
|
106
|
+
def complete_latest_message(self, msg_suite):
|
107
|
+
"""complete the latest added message
|
108
|
+
"""
|
109
|
+
if not self.messages:
|
110
|
+
raise ValueError('unable to complete last message as there is no previous message)')
|
111
|
+
if self.messages[-1][1]: # sub messages
|
112
|
+
self.messages[-1][1][-1].append(msg_suite)
|
113
|
+
else: # message
|
114
|
+
self.messages[-1][0].append(msg_suite)
|
115
|
+
|
116
|
+
def add_sub_message(self, sub_msg, key=None):
|
117
|
+
if not self.messages:
|
118
|
+
raise ValueError('unable to complete last message as there is no previous message)')
|
119
|
+
if key is None:
|
120
|
+
self.messages[-1][1].append([sub_msg])
|
121
|
+
else:
|
122
|
+
raise NotImplementedError("sub message to specific key are not implemented yet")
|
123
|
+
|
124
|
+
def write(self, stream=sys.stdout):
|
125
|
+
"""write the entry to file """
|
126
|
+
stream.write('%s -- %s\n' % (self.date or '', self.version or ''))
|
127
|
+
for msg, sub_msgs in self.messages:
|
128
|
+
stream.write('%s%s %s\n' % (INDENT, BULLET, msg[0]))
|
129
|
+
stream.write(''.join(msg[1:]))
|
130
|
+
if sub_msgs:
|
131
|
+
stream.write('\n')
|
132
|
+
for sub_msg in sub_msgs:
|
133
|
+
stream.write('%s%s %s\n' % (INDENT * 2, SUBBULLET, sub_msg[0]))
|
134
|
+
stream.write(''.join(sub_msg[1:]))
|
135
|
+
stream.write('\n')
|
136
|
+
|
137
|
+
stream.write('\n\n')
|
138
|
+
|
139
|
+
class ChangeLog(object):
|
140
|
+
"""object representation of a whole ChangeLog file"""
|
141
|
+
|
142
|
+
entry_class = ChangeLogEntry
|
143
|
+
|
144
|
+
def __init__(self, changelog_file, title=''):
|
145
|
+
self.file = changelog_file
|
146
|
+
self.title = title
|
147
|
+
self.additional_content = ''
|
148
|
+
self.entries = []
|
149
|
+
self.load()
|
150
|
+
|
151
|
+
def __repr__(self):
|
152
|
+
return '<ChangeLog %s at %s (%s entries)>' % (self.file, id(self),
|
153
|
+
len(self.entries))
|
154
|
+
|
155
|
+
def add_entry(self, entry):
|
156
|
+
"""add a new entry to the change log"""
|
157
|
+
self.entries.append(entry)
|
158
|
+
|
159
|
+
def get_entry(self, version='', create=None):
|
160
|
+
""" return a given changelog entry
|
161
|
+
if version is omitted, return the current entry
|
162
|
+
"""
|
163
|
+
if not self.entries:
|
164
|
+
if version or not create:
|
165
|
+
raise NoEntry()
|
166
|
+
self.entries.append(self.entry_class())
|
167
|
+
if not version:
|
168
|
+
if self.entries[0].version and create is not None:
|
169
|
+
self.entries.insert(0, self.entry_class())
|
170
|
+
return self.entries[0]
|
171
|
+
version = self.version_class(version)
|
172
|
+
for entry in self.entries:
|
173
|
+
if entry.version == version:
|
174
|
+
return entry
|
175
|
+
raise EntryNotFound()
|
176
|
+
|
177
|
+
def add(self, msg, create=None):
|
178
|
+
"""add a new message to the latest opened entry"""
|
179
|
+
entry = self.get_entry(create=create)
|
180
|
+
entry.add_message(msg)
|
181
|
+
|
182
|
+
def load(self):
|
183
|
+
""" read a logilab's ChangeLog from file """
|
184
|
+
try:
|
185
|
+
stream = open(self.file)
|
186
|
+
except IOError:
|
187
|
+
return
|
188
|
+
last = None
|
189
|
+
expect_sub = False
|
190
|
+
for line in stream.readlines():
|
191
|
+
sline = line.strip()
|
192
|
+
words = sline.split()
|
193
|
+
# if new entry
|
194
|
+
if len(words) == 1 and words[0] == '--':
|
195
|
+
expect_sub = False
|
196
|
+
last = self.entry_class()
|
197
|
+
self.add_entry(last)
|
198
|
+
# if old entry
|
199
|
+
elif len(words) == 3 and words[1] == '--':
|
200
|
+
expect_sub = False
|
201
|
+
last = self.entry_class(words[0], words[2])
|
202
|
+
self.add_entry(last)
|
203
|
+
# if title
|
204
|
+
elif sline and last is None:
|
205
|
+
self.title = '%s%s' % (self.title, line)
|
206
|
+
# if new entry
|
207
|
+
elif sline and sline[0] == BULLET:
|
208
|
+
expect_sub = False
|
209
|
+
last.add_message(sline[1:].strip())
|
210
|
+
# if new sub_entry
|
211
|
+
elif expect_sub and sline and sline[0] == SUBBULLET:
|
212
|
+
last.add_sub_message(sline[1:].strip())
|
213
|
+
# if new line for current entry
|
214
|
+
elif sline and last.messages:
|
215
|
+
last.complete_latest_message(line)
|
216
|
+
else:
|
217
|
+
expect_sub = True
|
218
|
+
self.additional_content += line
|
219
|
+
stream.close()
|
220
|
+
|
221
|
+
def format_title(self):
|
222
|
+
return '%s\n\n' % self.title.strip()
|
223
|
+
|
224
|
+
def save(self):
|
225
|
+
"""write back change log"""
|
226
|
+
# filetutils isn't importable in appengine, so import locally
|
227
|
+
from logilab.common.fileutils import ensure_fs_mode
|
228
|
+
ensure_fs_mode(self.file, S_IWRITE)
|
229
|
+
self.write(open(self.file, 'w'))
|
230
|
+
|
231
|
+
def write(self, stream=sys.stdout):
|
232
|
+
"""write changelog to stream"""
|
233
|
+
stream.write(self.format_title())
|
234
|
+
for entry in self.entries:
|
235
|
+
entry.write(stream)
|
236
|
+
|
Binary file
|
@@ -0,0 +1,332 @@
|
|
1
|
+
# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
|
2
|
+
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
|
3
|
+
#
|
4
|
+
# This file is part of logilab-common.
|
5
|
+
#
|
6
|
+
# logilab-common is free software: you can redistribute it and/or modify it under
|
7
|
+
# the terms of the GNU Lesser General Public License as published by the Free
|
8
|
+
# Software Foundation, either version 2.1 of the License, or (at your option) any
|
9
|
+
# later version.
|
10
|
+
#
|
11
|
+
# logilab-common is distributed in the hope that it will be useful, but WITHOUT
|
12
|
+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
13
|
+
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
14
|
+
# details.
|
15
|
+
#
|
16
|
+
# You should have received a copy of the GNU Lesser General Public License along
|
17
|
+
# with logilab-common. If not, see <http://www.gnu.org/licenses/>.
|
18
|
+
"""Helper functions to support command line tools providing more than
|
19
|
+
one command.
|
20
|
+
|
21
|
+
e.g called as "tool command [options] args..." where <options> and <args> are
|
22
|
+
command'specific
|
23
|
+
"""
|
24
|
+
|
25
|
+
__docformat__ = "restructuredtext en"
|
26
|
+
|
27
|
+
import sys
|
28
|
+
import logging
|
29
|
+
from os.path import basename
|
30
|
+
|
31
|
+
from logilab.common.configuration import Configuration
|
32
|
+
from logilab.common.logging_ext import init_log, get_threshold
|
33
|
+
from logilab.common.deprecation import deprecated
|
34
|
+
|
35
|
+
|
36
|
+
class BadCommandUsage(Exception):
|
37
|
+
"""Raised when an unknown command is used or when a command is not
|
38
|
+
correctly used (bad options, too much / missing arguments...).
|
39
|
+
|
40
|
+
Trigger display of command usage.
|
41
|
+
"""
|
42
|
+
|
43
|
+
class CommandError(Exception):
|
44
|
+
"""Raised when a command can't be processed and we want to display it and
|
45
|
+
exit, without traceback nor usage displayed.
|
46
|
+
"""
|
47
|
+
|
48
|
+
|
49
|
+
# command line access point ####################################################
|
50
|
+
|
51
|
+
class CommandLine(dict):
|
52
|
+
"""Usage:
|
53
|
+
|
54
|
+
>>> LDI = cli.CommandLine('ldi', doc='Logilab debian installer',
|
55
|
+
version=version, rcfile=RCFILE)
|
56
|
+
>>> LDI.register(MyCommandClass)
|
57
|
+
>>> LDI.register(MyOtherCommandClass)
|
58
|
+
>>> LDI.run(sys.argv[1:])
|
59
|
+
|
60
|
+
Arguments:
|
61
|
+
|
62
|
+
* `pgm`, the program name, default to `basename(sys.argv[0])`
|
63
|
+
|
64
|
+
* `doc`, a short description of the command line tool
|
65
|
+
|
66
|
+
* `copyright`, additional doc string that will be appended to the generated
|
67
|
+
doc
|
68
|
+
|
69
|
+
* `version`, version number of string of the tool. If specified, global
|
70
|
+
--version option will be available.
|
71
|
+
|
72
|
+
* `rcfile`, path to a configuration file. If specified, global --C/--rc-file
|
73
|
+
option will be available? self.rcfile = rcfile
|
74
|
+
|
75
|
+
* `logger`, logger to propagate to commands, default to
|
76
|
+
`logging.getLogger(self.pgm))`
|
77
|
+
"""
|
78
|
+
def __init__(self, pgm=None, doc=None, copyright=None, version=None,
|
79
|
+
rcfile=None, logthreshold=logging.ERROR,
|
80
|
+
check_duplicated_command=True):
|
81
|
+
if pgm is None:
|
82
|
+
pgm = basename(sys.argv[0])
|
83
|
+
self.pgm = pgm
|
84
|
+
self.doc = doc
|
85
|
+
self.copyright = copyright
|
86
|
+
self.version = version
|
87
|
+
self.rcfile = rcfile
|
88
|
+
self.logger = None
|
89
|
+
self.logthreshold = logthreshold
|
90
|
+
self.check_duplicated_command = check_duplicated_command
|
91
|
+
|
92
|
+
def register(self, cls, force=False):
|
93
|
+
"""register the given :class:`Command` subclass"""
|
94
|
+
assert not self.check_duplicated_command or force or not cls.name in self, \
|
95
|
+
'a command %s is already defined' % cls.name
|
96
|
+
self[cls.name] = cls
|
97
|
+
return cls
|
98
|
+
|
99
|
+
def run(self, args):
|
100
|
+
"""main command line access point:
|
101
|
+
* init logging
|
102
|
+
* handle global options (-h/--help, --version, -C/--rc-file)
|
103
|
+
* check command
|
104
|
+
* run command
|
105
|
+
|
106
|
+
Terminate by :exc:`SystemExit`
|
107
|
+
"""
|
108
|
+
init_log(debug=True, # so that we use StreamHandler
|
109
|
+
logthreshold=self.logthreshold,
|
110
|
+
logformat='%(levelname)s: %(message)s')
|
111
|
+
try:
|
112
|
+
arg = args.pop(0)
|
113
|
+
except IndexError:
|
114
|
+
self.usage_and_exit(1)
|
115
|
+
if arg in ('-h', '--help'):
|
116
|
+
self.usage_and_exit(0)
|
117
|
+
if self.version is not None and arg in ('--version'):
|
118
|
+
print self.version
|
119
|
+
sys.exit(0)
|
120
|
+
rcfile = self.rcfile
|
121
|
+
if rcfile is not None and arg in ('-C', '--rc-file'):
|
122
|
+
try:
|
123
|
+
rcfile = args.pop(0)
|
124
|
+
arg = args.pop(0)
|
125
|
+
except IndexError:
|
126
|
+
self.usage_and_exit(1)
|
127
|
+
try:
|
128
|
+
command = self.get_command(arg)
|
129
|
+
except KeyError:
|
130
|
+
print 'ERROR: no %s command' % arg
|
131
|
+
print
|
132
|
+
self.usage_and_exit(1)
|
133
|
+
try:
|
134
|
+
sys.exit(command.main_run(args, rcfile))
|
135
|
+
except KeyboardInterrupt, exc:
|
136
|
+
print 'Interrupted',
|
137
|
+
if str(exc):
|
138
|
+
print ': %s' % exc,
|
139
|
+
print
|
140
|
+
sys.exit(4)
|
141
|
+
except BadCommandUsage, err:
|
142
|
+
print 'ERROR:', err
|
143
|
+
print
|
144
|
+
print command.help()
|
145
|
+
sys.exit(1)
|
146
|
+
|
147
|
+
def create_logger(self, handler, logthreshold=None):
|
148
|
+
logger = logging.Logger(self.pgm)
|
149
|
+
logger.handlers = [handler]
|
150
|
+
if logthreshold is None:
|
151
|
+
logthreshold = get_threshold(self.logthreshold)
|
152
|
+
logger.setLevel(logthreshold)
|
153
|
+
return logger
|
154
|
+
|
155
|
+
def get_command(self, cmd, logger=None):
|
156
|
+
if logger is None:
|
157
|
+
logger = self.logger
|
158
|
+
if logger is None:
|
159
|
+
logger = self.logger = logging.getLogger(self.pgm)
|
160
|
+
logger.setLevel(get_threshold(self.logthreshold))
|
161
|
+
return self[cmd](logger)
|
162
|
+
|
163
|
+
def usage(self):
|
164
|
+
"""display usage for the main program (i.e. when no command supplied)
|
165
|
+
and exit
|
166
|
+
"""
|
167
|
+
print 'usage:', self.pgm,
|
168
|
+
if self.rcfile:
|
169
|
+
print '[--rc-file=<configuration file>]',
|
170
|
+
print '<command> [options] <command argument>...'
|
171
|
+
if self.doc:
|
172
|
+
print '\n%s' % self.doc
|
173
|
+
print '''
|
174
|
+
Type "%(pgm)s <command> --help" for more information about a specific
|
175
|
+
command. Available commands are :\n''' % self.__dict__
|
176
|
+
max_len = max([len(cmd) for cmd in self])
|
177
|
+
padding = ' ' * max_len
|
178
|
+
for cmdname, cmd in sorted(self.items()):
|
179
|
+
if not cmd.hidden:
|
180
|
+
print ' ', (cmdname + padding)[:max_len], cmd.short_description()
|
181
|
+
if self.rcfile:
|
182
|
+
print '''
|
183
|
+
Use --rc-file=<configuration file> / -C <configuration file> before the command
|
184
|
+
to specify a configuration file. Default to %s.
|
185
|
+
''' % self.rcfile
|
186
|
+
print '''%(pgm)s -h/--help
|
187
|
+
display this usage information and exit''' % self.__dict__
|
188
|
+
if self.version:
|
189
|
+
print '''%(pgm)s -v/--version
|
190
|
+
display version configuration and exit''' % self.__dict__
|
191
|
+
if self.copyright:
|
192
|
+
print '\n', self.copyright
|
193
|
+
|
194
|
+
def usage_and_exit(self, status):
|
195
|
+
self.usage()
|
196
|
+
sys.exit(status)
|
197
|
+
|
198
|
+
|
199
|
+
# base command classes #########################################################
|
200
|
+
|
201
|
+
class Command(Configuration):
|
202
|
+
"""Base class for command line commands.
|
203
|
+
|
204
|
+
Class attributes:
|
205
|
+
|
206
|
+
* `name`, the name of the command
|
207
|
+
|
208
|
+
* `min_args`, minimum number of arguments, None if unspecified
|
209
|
+
|
210
|
+
* `max_args`, maximum number of arguments, None if unspecified
|
211
|
+
|
212
|
+
* `arguments`, string describing arguments, used in command usage
|
213
|
+
|
214
|
+
* `hidden`, boolean flag telling if the command should be hidden, e.g. does
|
215
|
+
not appear in help's commands list
|
216
|
+
|
217
|
+
* `options`, options list, as allowed by :mod:configuration
|
218
|
+
"""
|
219
|
+
|
220
|
+
arguments = ''
|
221
|
+
name = ''
|
222
|
+
# hidden from help ?
|
223
|
+
hidden = False
|
224
|
+
# max/min args, None meaning unspecified
|
225
|
+
min_args = None
|
226
|
+
max_args = None
|
227
|
+
|
228
|
+
@classmethod
|
229
|
+
def description(cls):
|
230
|
+
return cls.__doc__.replace(' ', '')
|
231
|
+
|
232
|
+
@classmethod
|
233
|
+
def short_description(cls):
|
234
|
+
return cls.description().split('.')[0]
|
235
|
+
|
236
|
+
def __init__(self, logger):
|
237
|
+
usage = '%%prog %s %s\n\n%s' % (self.name, self.arguments,
|
238
|
+
self.description())
|
239
|
+
Configuration.__init__(self, usage=usage)
|
240
|
+
self.logger = logger
|
241
|
+
|
242
|
+
def check_args(self, args):
|
243
|
+
"""check command's arguments are provided"""
|
244
|
+
if self.min_args is not None and len(args) < self.min_args:
|
245
|
+
raise BadCommandUsage('missing argument')
|
246
|
+
if self.max_args is not None and len(args) > self.max_args:
|
247
|
+
raise BadCommandUsage('too many arguments')
|
248
|
+
|
249
|
+
def main_run(self, args, rcfile=None):
|
250
|
+
"""Run the command and return status 0 if everything went fine.
|
251
|
+
|
252
|
+
If :exc:`CommandError` is raised by the underlying command, simply log
|
253
|
+
the error and return status 2.
|
254
|
+
|
255
|
+
Any other exceptions, including :exc:`BadCommandUsage` will be
|
256
|
+
propagated.
|
257
|
+
"""
|
258
|
+
if rcfile:
|
259
|
+
self.load_file_configuration(rcfile)
|
260
|
+
args = self.load_command_line_configuration(args)
|
261
|
+
try:
|
262
|
+
self.check_args(args)
|
263
|
+
self.run(args)
|
264
|
+
except CommandError, err:
|
265
|
+
self.logger.error(err)
|
266
|
+
return 2
|
267
|
+
return 0
|
268
|
+
|
269
|
+
def run(self, args):
|
270
|
+
"""run the command with its specific arguments"""
|
271
|
+
raise NotImplementedError()
|
272
|
+
|
273
|
+
|
274
|
+
class ListCommandsCommand(Command):
|
275
|
+
"""list available commands, useful for bash completion."""
|
276
|
+
name = 'listcommands'
|
277
|
+
arguments = '[command]'
|
278
|
+
hidden = True
|
279
|
+
|
280
|
+
def run(self, args):
|
281
|
+
"""run the command with its specific arguments"""
|
282
|
+
if args:
|
283
|
+
command = args.pop()
|
284
|
+
cmd = _COMMANDS[command]
|
285
|
+
for optname, optdict in cmd.options:
|
286
|
+
print '--help'
|
287
|
+
print '--' + optname
|
288
|
+
else:
|
289
|
+
commands = sorted(_COMMANDS.keys())
|
290
|
+
for command in commands:
|
291
|
+
cmd = _COMMANDS[command]
|
292
|
+
if not cmd.hidden:
|
293
|
+
print command
|
294
|
+
|
295
|
+
|
296
|
+
# deprecated stuff #############################################################
|
297
|
+
|
298
|
+
_COMMANDS = CommandLine()
|
299
|
+
|
300
|
+
DEFAULT_COPYRIGHT = '''\
|
301
|
+
Copyright (c) 2004-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
|
302
|
+
http://www.logilab.fr/ -- mailto:contact@logilab.fr'''
|
303
|
+
|
304
|
+
@deprecated('use cls.register(cli)')
|
305
|
+
def register_commands(commands):
|
306
|
+
"""register existing commands"""
|
307
|
+
for command_klass in commands:
|
308
|
+
_COMMANDS.register(command_klass)
|
309
|
+
|
310
|
+
@deprecated('use args.pop(0)')
|
311
|
+
def main_run(args, doc=None, copyright=None, version=None):
|
312
|
+
"""command line tool: run command specified by argument list (without the
|
313
|
+
program name). Raise SystemExit with status 0 if everything went fine.
|
314
|
+
|
315
|
+
>>> main_run(sys.argv[1:])
|
316
|
+
"""
|
317
|
+
_COMMANDS.doc = doc
|
318
|
+
_COMMANDS.copyright = copyright
|
319
|
+
_COMMANDS.version = version
|
320
|
+
_COMMANDS.run(args)
|
321
|
+
|
322
|
+
@deprecated('use args.pop(0)')
|
323
|
+
def pop_arg(args_list, expected_size_after=None, msg="Missing argument"):
|
324
|
+
"""helper function to get and check command line arguments"""
|
325
|
+
try:
|
326
|
+
value = args_list.pop(0)
|
327
|
+
except IndexError:
|
328
|
+
raise BadCommandUsage(msg)
|
329
|
+
if expected_size_after is not None and len(args_list) > expected_size_after:
|
330
|
+
raise BadCommandUsage('too many arguments')
|
331
|
+
return value
|
332
|
+
|