Permalink
Browse files

Update to enable command line access to JS scraping features.

  • Loading branch information...
1 parent cf6903b commit 646408475e8e563566133ad5ee8caa2dbcb6a329 @mattbasta committed Aug 8, 2011
Showing with 14 additions and 1 deletion.
  1. +5 −0 validator/errorbundler.py
  2. +8 −0 validator/main.py
  3. +1 −1 validator/validate.py
@@ -323,6 +323,11 @@ def render_json(self):
notice["type"] = "notice"
messages.append(notice)
+ if self.get_resource("scrape"):
+ output["js"] = self.get_resource("js")
+ output["js_identifiers"] = \
+ list(self.get_resource("js_identifiers"))
+
# Output the JSON.
return json.dumps(output)
View
@@ -88,6 +88,10 @@ def main():
compatibility tests:
{"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}": ["6.*"]}
""")
+ parser.add_argument("--scrape",
+ action="store_const",
+ const=True,
+ help="If set, JS will be scraped from the add-on.")
args = parser.parse_args()
@@ -118,6 +122,10 @@ def main():
overrides=overrides,
for_appversions=for_appversions)
+ # If we're scraping JS, put it in the error bundle.
+ if args.scrape:
+ error_bundle.save_resource("scrape", args.scrape, pushable=False)
+
# Print the output of the tests based on the requested format.
if args.output == "text":
print error_bundle.print_summary(verbose=args.verbose,
View
@@ -43,7 +43,7 @@ def validate(path, format="json",
if spidermonkey != False:
bundle.save_resource("SPIDERMONKEY", spidermonkey)
- bundle.save_resource("scrape", scrape)
+ bundle.save_resource("scrape", scrape, pushable=False)
validator.submain.prepare_package(bundle, path, expectation,
for_appversions=for_appversions)

0 comments on commit 6464084

Please sign in to comment.