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

Side by Side Diff: third_party/mojo/src/mojo/public/tools/dart_package_name.py

Issue 1157573002: Revert "Update mojo sdk to rev 1dc8a9a5db73d3718d99917fadf31f5fb2ebad4f" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
OLDNEW
(Empty)
1 #!/usr/bin/python
2 # Copyright 2015 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 """This script outputs the package name specified in the pubspec.yaml"""
7
8 import argparse
9 import os
10 import sys
11
12 # TODO(johnmccutchan): Use the yaml package to parse.
13 def PackageName(line):
14 assert line.startswith("name:")
15 return line.split(":")[1].strip()
16
17 def main(pubspec_file):
18 source_file = open(pubspec_file, "r")
19 for line in source_file:
20 if line.startswith("name:"):
21 print(PackageName(line))
22 return 0
23 source_file.close()
24 # Couldn't find it.
25 return -1
26
27 if __name__ == '__main__':
28 parser = argparse.ArgumentParser(
29 description="This script outputs the package name specified in the"
30 "pubspec.yaml")
31 parser.add_argument("--pubspec",
32 dest="pubspec_file",
33 metavar="<pubspec-file>",
34 type=str,
35 required=True,
36 help="Path to pubspec file")
37 args = parser.parse_args()
38 sys.exit(main(args.pubspec_file))
OLDNEW
« no previous file with comments | « third_party/mojo/src/mojo/public/tools/dart_package.py ('k') | third_party/mojo/src/mojo/public/tools/dart_pkg.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698