lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20231130143822.17173-1-2023002089@link.tyut.edu.cn>
Date:   Thu, 30 Nov 2023 22:38:22 +0800
From:   Hu Haowen <2023002089@...k.tyut.edu.cn>
To:     gregkh@...uxfoundation.org, akpm@...ux-foundation.org
Cc:     Hu Haowen <2023002089@...k.tyut.edu.cn>, masahiroy@...nel.org,
        ndesaulniers@...gle.com, n.schier@....de, ojeda@...nel.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH] scripts/show_delta: reformat code

Correct some lines in irregular coding style to make them look more
harmonious and fit the common coding regulations in Python.

Signed-off-by: Hu Haowen <2023002089@...k.tyut.edu.cn>
---
 scripts/show_delta | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/scripts/show_delta b/scripts/show_delta
index 291ad65e3089..f5e42780ee7b 100755
--- a/scripts/show_delta
+++ b/scripts/show_delta
@@ -13,7 +13,7 @@ import sys
 import string
 
 def usage():
-	print ("""usage: show_delta [<options>] <filename>
+	print("""usage: show_delta [<options>] <filename>
 
 This program parses the output from a set of printk message lines which
 have time data prefixed because the CONFIG_PRINTK_TIME option is set, or
@@ -46,7 +46,7 @@ def get_time(line):
 		raise ValueError
 
 	# split on closing bracket
-	(time_str, rest) = string.split(line[1:],']',1)
+	(time_str, rest) = string.split(line[1:], ']', 1)
 	time = string.atof(time_str)
 
 	#print "time=", time
@@ -82,7 +82,7 @@ def main():
 	filein = ""
 	for arg in sys.argv[1:]:
 		if arg=="-b":
-			base_str = sys.argv[sys.argv.index("-b")+1]
+			base_str = sys.argv[sys.argv.index("-b") + 1]
 		elif arg=="-h":
 			usage()
 		else:
@@ -111,19 +111,19 @@ def main():
 					(time, rest) = get_time(line)
 				except:
 					continue
-				if string.find(rest, base_str)==1:
+				if string.find(rest, base_str) == 1:
 					base_time = time
 					found = 1
 					# stop at first match
 					break
 			if not found:
-				print ('Couldn\'t find line matching base pattern "%s"' % base_str)
+				print('Couldn\'t find line matching base pattern "%s"' % base_str)
 				sys.exit(1)
 	else:
 		base_time = 0.0
 
 	for line in lines:
-		print (convert_line(line, base_time),)
+		print(convert_line(line, base_time),)
 
 if __name__ == "__main__":
 	main()
-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ