33# Minor changes for NUT by Charles Lepple
44# Distributed under the terms of the GNU General Public License v2 or later
55
6- import string, re, os
6+ import re
7+ import os
78from textwrap import TextWrapper
89import sys
910import subprocess
4041 fin, ferr = p.communicate()
4142 if p.wait() != 0:
4243 print("ERROR getting git changelog")
43- system .exit(1)
44+ sys .exit(1)
4445 fin = fin.splitlines()
4546 fin_mode = 3
4647except TypeError:
@@ -69,7 +70,10 @@ files = ""
6970prevAuthorLine = ""
7071
7172wrapper = TextWrapper(
72- initial_indent=" ", subsequent_indent=" ", width=78, break_on_hyphens=False
73+ initial_indent=" ",
74+ subsequent_indent=" ",
75+ width=78,
76+ break_on_hyphens=False
7377)
7478
7579# The main part of the loop
@@ -115,7 +119,7 @@ for line in fin:
115119 elif "Signed-off-by" in line:
116120 continue
117121 # Extract the actual commit message for this commit
118- elif authorFound & dateFound & messageFound == False:
122+ elif authorFound & dateFound & messageFound is False:
119123 # Find the commit message if we can
120124 if len(line) == fin_chop:
121125 if messageNL:
@@ -135,7 +139,7 @@ for line in fin:
135139 continue
136140 # Collect the files for this commit. FIXME: Still need to add +/- to files
137141 elif authorFound & dateFound & messageFound:
138- fileList = re.split(" \| " , line, 2)
142+ fileList = re.split(r' \| ' , line, 2)
139143 if len(fileList) > 1:
140144 if len(files) > 0:
141145 files = files + ", " + fileList[0].strip()
0 commit comments