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

Unified Diff: grit/tool/buildinfo.py

Issue 1442863002: Remove contents of grit's SVN repository. (Closed) Base URL: http://grit-i18n.googlecode.com/svn/trunk/
Patch Set: Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « grit/tool/build_unittest.py ('k') | grit/tool/buildinfo_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: grit/tool/buildinfo.py
===================================================================
--- grit/tool/buildinfo.py (revision 202)
+++ grit/tool/buildinfo.py (working copy)
@@ -1,68 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Output the list of files to be generated by GRIT from an input.
-"""
-
-import getopt
-import os
-
-from grit import grd_reader
-from grit.node import structure
-from grit.tool import interface
-
-class DetermineBuildInfo(interface.Tool):
- """Determine what files will be read and output by GRIT."""
-
- def __init__(self):
- pass
-
- def ShortDescription(self):
- """Describes this tool for the usage message."""
- return ('Determine what files will be needed and\n'
- 'output by GRIT with a given input.')
-
- def Run(self, opts, args):
- """Main method for the buildinfo tool. Outputs the list
- of generated files and inputs used to stdout."""
- self.output_directory = '.'
- (own_opts, args) = getopt.getopt(args, 'o:')
- for (key, val) in own_opts:
- if key == '-o':
- self.output_directory = val
- if len(args) > 0:
- print 'This tool takes exactly one argument: the output directory via -o'
- return 2
- self.SetOptions(opts)
-
- res_tree = grd_reader.Parse(opts.input, debug=opts.extra_verbose)
-
- langs = {}
- for output in res_tree.GetOutputFiles():
- if output.attrs['lang']:
- langs[output.attrs['lang']] = os.path.dirname(output.GetFilename())
-
- for lang, dirname in langs.iteritems():
- old_output_language = res_tree.output_language
- res_tree.SetOutputLanguage(lang)
- for node in res_tree.ActiveDescendants():
- with node:
- if (isinstance(node, structure.StructureNode) and
- node.HasFileForLanguage()):
- path = node.FileForLanguage(lang, dirname, create_file=False,
- return_if_not_generated=False)
- if path:
- path = os.path.join(self.output_directory, path)
- path = os.path.normpath(path)
- print '%s|%s' % ('rc_all', path)
- res_tree.SetOutputLanguage(old_output_language)
-
- for output in res_tree.GetOutputFiles():
- path = os.path.join(self.output_directory, output.GetFilename())
- path = os.path.normpath(path)
- print '%s|%s' % (output.GetType(), path)
-
- for infile in res_tree.GetInputFiles():
- print 'input|%s' % os.path.normpath(infile)
« no previous file with comments | « grit/tool/build_unittest.py ('k') | grit/tool/buildinfo_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698