Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(383)

Side by Side Diff: client/tools/htmlconverter.py

Issue 9789004: Move copy_dart.py from client to tools (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « client/tools/copy_dart.py ('k') | lib/dom/scripts/dartdomgenerator.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 # for details. All rights reserved. Use of this source code is governed by a 2 # for details. All rights reserved. Use of this source code is governed by a
3 # BSD-style license that can be found in the LICENSE file. 3 # BSD-style license that can be found in the LICENSE file.
4 4
5 #!/usr/bin/env python 5 #!/usr/bin/env python
6 # 6 #
7 7
8 """Rewrites HTML files, converting Dart script sections into JavaScript. 8 """Rewrites HTML files, converting Dart script sections into JavaScript.
9 9
10 Process HTML files, and internally changes script sections that use Dart code 10 Process HTML files, and internally changes script sections that use Dart code
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 # Note: can't use super calls because HTMLParser is not a subclass of object 363 # Note: can't use super calls because HTMLParser is not a subclass of object
364 DartHTMLConverter.__init__(self, None, prefix_path) 364 DartHTMLConverter.__init__(self, None, prefix_path)
365 self.outdir = outdir 365 self.outdir = outdir
366 self.verbose = verbose 366 self.verbose = verbose
367 367
368 def compileScript(self, attrDic): 368 def compileScript(self, attrDic):
369 self.contains_dart = True 369 self.contains_dart = True
370 if 'src' in attrDic: 370 if 'src' in attrDic:
371 status, out, err = execute([ 371 status, out, err = execute([
372 sys.executable, 372 sys.executable,
373 join(CLIENT_PATH, 'tools', 'copy_dart.py'), 373 join(DART_PATH, 'tools', 'copy_dart.py'),
374 self.outdir, 374 self.outdir,
375 convertPath(attrDic['src'], self.prefix_path)], 375 convertPath(attrDic['src'], self.prefix_path)],
376 self.verbose) 376 self.verbose)
377 377
378 if status: 378 if status:
379 raise ConverterException('exception calling copy_dart.py') 379 raise ConverterException('exception calling copy_dart.py')
380 380
381 # do not rewrite the script tag 381 # do not rewrite the script tag
382 return False 382 return False
383 383
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 if 'dartium' in options.target: 566 if 'dartium' in options.target:
567 convertForDartium(filename, options.out, 567 convertForDartium(filename, options.out,
568 outfile.replace(extension, '-dart' + extension), options.verbose) 568 outfile.replace(extension, '-dart' + extension), options.verbose)
569 except Exception as e: 569 except Exception as e:
570 print "%sERROR%s: %s" % (RED_COLOR, NO_COLOR, str(e)) 570 print "%sERROR%s: %s" % (RED_COLOR, NO_COLOR, str(e))
571 return 1 571 return 1
572 return 0 572 return 0
573 573
574 if __name__ == '__main__': 574 if __name__ == '__main__':
575 sys.exit(main()) 575 sys.exit(main())
OLDNEW
« no previous file with comments | « client/tools/copy_dart.py ('k') | lib/dom/scripts/dartdomgenerator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698