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

Unified Diff: my_activity.py

Issue 116873002: Add more formatting options for my_activity.py (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Review feedback Created 7 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: my_activity.py
diff --git a/my_activity.py b/my_activity.py
index d8a093a81fcfa980a926d83c5c6405f51260562d..fa08a0c9c83db517e5d70258b193485e660d0f17 100755
--- a/my_activity.py
+++ b/my_activity.py
@@ -797,6 +797,10 @@ class MyActivity(object):
print "No %s in committers.py, skipping WebKit checks." % email
self.webkit_repo = None
+ def print_heading(self, heading):
+ print
+ print self.options.output_format_heading.format(heading=heading)
+
def print_change(self, change):
optional_values = {
'reviewers': ', '.join(change['reviewers'])
@@ -894,7 +898,7 @@ class MyActivity(object):
def print_changes(self):
if self.changes:
- print '\nChanges:'
+ self.print_heading('Changes')
for change in self.changes:
self.print_change(change)
@@ -912,7 +916,7 @@ class MyActivity(object):
def print_reviews(self):
if self.reviews:
- print '\nReviews:'
+ self.print_heading('Reviews')
for review in self.reviews:
self.print_review(review)
@@ -925,7 +929,7 @@ class MyActivity(object):
def print_issues(self):
if self.issues:
- print '\nIssues:'
+ self.print_heading('Issues')
for issue in self.issues:
self.print_issue(issue)
@@ -1031,6 +1035,14 @@ def main():
'--output-format-reviews', metavar='<format>',
default=None,
help='Specifies the format to use when printing reviews.')
+ output_format_group.add_option(
+ '--output-format-heading', metavar='<format>',
+ default=u'{heading}:',
+ help='Specifies the format to use when printing headings.')
+ output_format_group.add_option(
+ '-m', '--markdown', action='store_true',
+ help='Use markdown-friendly output (overrides --output-format '
+ 'and --output-format-heading)')
parser.add_option_group(output_format_group)
# Remove description formatting
@@ -1063,6 +1075,10 @@ def main():
end = datetime.today()
options.begin, options.end = begin, end
+ if options.markdown:
+ options.output_format = ' * [{title}]({url})'
+ options.output_format_heading = '### {heading} ###'
+
print 'Searching for activity by %s' % options.user
print 'Using range %s to %s' % (options.begin, options.end)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698