#37 Add switch to surpress the Bodhi comments
Merged 3 months ago by kparal. Opened 3 months ago by lruzicka.

file modified
+12 -1
@@ -48,6 +48,7 @@ 

              bugzilla_bug_url="https://bugzilla.redhat.com/",

              test_cases_url="https://fedoraproject.org/wiki/",

              wrap_bugs=True,

+             skip_bodhi_comments=False,

              width=80):

  

          # copy update to avoid side effects
@@ -156,6 +157,9 @@ 

                  # the format of the user has changed, add a data member

                  comment["username"] = comment["user"]["name"]

  

+                 if comment['username'] == 'bodhi' and skip_bodhi_comments:

+                     continue

+ 

                  comments.append(

                      "%(indent)s%(username)s - %(timestamp)s "

                      "(karma %(karma)s)" % comment
@@ -404,6 +408,12 @@ 

                            default=3,

                            type="int")

          parser.add_option("",

+                           "--skip-bodhi-comments",

+                           dest="skip_bodhi_comments",

+                           help="Do not show comments created by bodhi",

+                           action="store_true",

+                           default=False)

+         parser.add_option("",

                            "--wrap-bugs",

                            dest="wrap_bugs",

                            help="Apply line-wrapping to bugs",
@@ -650,7 +660,8 @@ 

                      print(FEK_helper.bodhi_update_str(

                          update, bodhi_base_url=self.bc.base_url,

                          width=self.options.wrap_width,

-                         wrap_bugs=self.options.wrap_bugs

+                         wrap_bugs=self.options.wrap_bugs,

+                         skip_bodhi_comments=self.options.skip_bodhi_comments

                      ))

                      if self.options.wrap_rpms:

                          print(FEK_helper.wrap_paragraphs_prefix(

Sometimes, Bodhi comments can be annoying for some users and
they wish for cleaner process. This adds a CLI switch --nobodhi
to surpress those comments and only show comments posted by
real users.

Fixes: https://pagure.io/fedora-easy-karma/issue/36

This also includes the previous commit, because I added this after the first commit, so that one should probably be merged first and this one could be rebased afterwards.

rebased onto 5eb4982

3 months ago

rebased onto 5eb4982

3 months ago

Hi. I rebased the PR on top of the current master (split it from the color changes), and adjusted the arg name to be more understandable. Is the change OK with you, can I commit it this way? Thanks.

Hi. I rebased the PR on top of the current master (split it from the color changes), and adjusted the arg name to be more understandable. Is the change OK with you, can I commit it this way? Thanks.

Yeah, sure. No problem with it. Thanks.

OK. The new arg is quite long, but the shorter version seemed confusing for unaware users :-/ I created a ticket how to avoid typing it every time:
https://pagure.io/fedora-easy-karma/issue/38

Commit d0eef5c fixes this pull-request

Pull-Request has been merged by kparal

3 months ago
Metadata