Chromium Code Reviews| Index: my_activity.py |
| diff --git a/my_activity.py b/my_activity.py |
| index d8a093a81fcfa980a926d83c5c6405f51260562d..926246be7d7a38582b37c7f88a887b6c9d37ae47 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 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,13 @@ 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( |
| + '--markdown', action='store_true', |
|
deymo
2013/12/17 01:38:16
I'm up for a '-m' short option as well. It looks l
jsbell
2013/12/17 18:59:55
Done.
|
| + help='Use markdown-friendly output formats') |
|
deymo
2013/12/17 01:38:16
hmm... I'd add a note about the fact that this ove
jsbell
2013/12/17 18:59:55
Done.
|
| parser.add_option_group(output_format_group) |
| # Remove description formatting |
| @@ -1063,6 +1074,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} ##' |
|
deymo
2013/12/17 01:38:16
I think that ## is too high. When the snippets are
jsbell
2013/12/17 18:59:55
Done.
|
| + |
| print 'Searching for activity by %s' % options.user |
| print 'Using range %s to %s' % (options.begin, options.end) |