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

Side by Side Diff: dart/runtime/tools/concat_library.py

Issue 10383103: Split the URI library across multiple files. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created helper.dart with SVN Created 8 years, 7 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 | « dart/runtime/bin/uri_sources.gypi ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
3 # for details. All rights reserved. Use of this source code is governed by a
4 # BSD-style license that can be found in the LICENSE file.
5
6 import optparse
7 import shutil
8 import sys
9
10 def parse_options(argv):
11 parser = optparse.OptionParser(usage="Usage: %prog [options] files")
12 parser.add_option("--output",
13 dest="output",
14 help="Write output to FILE.",
15 metavar="FILE")
16 (options, arguments) = parser.parse_args(argv[1:])
17 if not arguments:
18 parser.error("At least one input file must be provided.")
19 if not options.output:
20 parser.error("No --output provided.")
21 return (options, arguments)
22
23
24 def main():
25 # Print the command that is being run. This is helpful when
26 # debugging build errors.
27 sys.stderr.write('%s\n' % ' '.join(sys.argv))
28 (options, arguments) = parse_options(sys.argv)
29 tmp_name = '%s.tmp' % options.output
30 with open(tmp_name, 'w') as output:
31 for source in arguments:
32 with open(source, 'r') as inpt:
33 for line in inpt:
34 if line.startswith('#source'):
35 line = '// %s' % line
36 output.write(line)
37 shutil.move(tmp_name, options.output)
38
39 if __name__ == '__main__':
40 main()
OLDNEW
« no previous file with comments | « dart/runtime/bin/uri_sources.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698