Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: ensure_dependencies.py

Issue 5784154620821504: Issue 1807 - Allow suppressing output of ensure_dependencies.py (Closed)
Patch Set: Created Jan. 14, 2015, 9:14 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ensure_dependencies.py
===================================================================
--- a/ensure_dependencies.py
+++ b/ensure_dependencies.py
@@ -9,16 +9,17 @@ import sys
import os
import posixpath
import re
import io
import errno
import logging
import subprocess
import urlparse
+import argparse
from collections import OrderedDict
from ConfigParser import RawConfigParser
USAGE = """
A dependencies file should look like this:
# VCS-specific root URLs for the repositories
@@ -273,13 +274,22 @@ def _ensure_line_exists(path, pattern):
file_content.append(pattern)
f.seek(0, os.SEEK_SET)
f.truncate()
for l in file_content:
print >>f, l
if __name__ == "__main__":
logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO)
- repos = sys.argv[1:]
+
+ parser = argparse.ArgumentParser(description="Verify dependencies for a set of repositories, by default the repository of this script.")
+ parser.add_argument("repos", metavar="repository", type=str, nargs="*", help="Repository path")
+ parser.add_argument("-q", "--quiet", action="store_true", help="Suppress informational output")
+ args = parser.parse_args()
+
+ if args.quiet:
+ logging.disable(logging.INFO)
+
+ repos = args.repos
if not len(repos):
repos = [os.path.dirname(__file__)]
for repo in repos:
resolve_deps(repo)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld