[Libreoffice-commits] dev-tools.git: ciabot/libreoffice-bugzilla2.py

Guilhem Moulin (via logerrit) logerrit at kemper.freedesktop.org
Wed Jul 1 23:15:03 UTC 2020


 ciabot/libreoffice-bugzilla2.py |   19 +++++--------------
 1 file changed, 5 insertions(+), 14 deletions(-)

New commits:
commit 7a647c3da1a93cc38fe922706f25124c384a4a48
Author:     Guilhem Moulin <guilhem at libreoffice.org>
AuthorDate: Thu Jul 2 01:13:10 2020 +0200
Commit:     Guilhem Moulin <guilhem at libreoffice.org>
CommitDate: Thu Jul 2 01:13:10 2020 +0200

    ciabot: Port libreoffice-bugzilla2.py to python3.

diff --git a/ciabot/libreoffice-bugzilla2.py b/ciabot/libreoffice-bugzilla2.py
index 8d11e31..8ba84e2 100644
--- a/ciabot/libreoffice-bugzilla2.py
+++ b/ciabot/libreoffice-bugzilla2.py
@@ -18,23 +18,14 @@
 # - adds a comment to the report
 # - updates the whiteboard field with target information
 
-from __future__ import print_function
-
 import datetime
 import os
 import re
 import sys, getopt
 import git
-import ConfigParser
-
-if hasattr(sys.version_info, "major") and sys.version_info.major >= 3:
-# pylint: disable=F0401,E0611
-    from urllib.parse import urlparse
-else:
-    from urlparse import urlparse
+import configparser
 
 import bugzilla
-from bugzilla import Bugzilla
 
 master_target = "7.1.0"
 bug_regex = "\\b(?:bug|fdo|tdf|lo)[#:]?(\\d+)\\b"
@@ -46,7 +37,7 @@ class FreedesktopBZ:
     bz = None
 
     def connect(self):
-        config = ConfigParser.ConfigParser()
+        config = configparser.ConfigParser()
         config.read(os.path.dirname(os.path.abspath(__file__)) + '/config.cfg')
         url = config.get('bugzilla', 'url')
         user = config.get('bugzilla', 'user')
@@ -58,7 +49,7 @@ class FreedesktopBZ:
     def update_whiteboard(self, commit, bugnr, new_version, branch, repo_name):
         print(bugnr)
         if dry_run:
-            print("DRY RUN, we would set the whiteboard to: target:\n%s" % new_version)
+            print(("DRY RUN, we would set the whiteboard to: target:\n%s" % new_version))
         else:
             bug = self.bz.getbug(bugnr)
             print(bug)
@@ -99,7 +90,7 @@ https://wiki.documentfoundation.org/Testing_Daily_Builds
 Affected users are encouraged to test the fix and report feedback.""" %(new_version)
 
         if dry_run:
-            print("DRY RUN, we would add the following comment:\n%s" % comment_msg)
+            print(("DRY RUN, we would add the following comment:\n%s" % comment_msg))
         else:
             bug.addcomment(comment_msg)
 
@@ -177,7 +168,7 @@ def find_bugid(repo, commit_id):
     return m
 
 def read_repo(repo_name):
-    config = ConfigParser.ConfigParser()
+    config = configparser.ConfigParser()
     config.read(os.path.dirname(os.path.abspath(__file__)) + '/config.cfg')
     path = config.get(repo_name, 'location')
     repo = git.repo.base.Repo(path)


More information about the Libreoffice-commits mailing list