[Replicant] PATCH fix improve readability/cognitive complexity in begining
Alexis
sk-alexis at protonmail.ch
Tue Jan 18 18:31:39 UTC 2022
Here is another patch for wiki migration scripts regarding a small improvement for readibility sakes and cognitive reasons
All this patches are for the main branch so we can make rebase wip changes
Carpe Diem, Irelativism
DiEM25.org Exarcheia/Tech.sov DSC
From 1ac146e3f3b0d1271ffdcfc0f076e527fccbd93c Mon Sep 17 00:00:00 2001
From: _I3^RELATIVISM <sk-alexis at protonmail.ch>
Date: Tue, 18 Jan 2022 18:27:14 +0000
Subject: [PATCH 3/3] improve readability/cognitive complexity in begining
---
redmine2git.py | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/redmine2git.py b/redmine2git.py
index 24fc34b..8bcfcf5 100755
--- a/redmine2git.py
+++ b/redmine2git.py
@@ -52,9 +52,8 @@ def write_page(extension, output_directory, page):
else:
file_path = output_directory + os.sep + page.title + extension
- f = open(file_path, 'w')
- f.write(page.text)
- f.close()
+ with open(file_path, 'w') as file:
+ file.write(page.text)
return [file_path]
--
2.20.1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osuosl.org/pipermail/replicant/attachments/20220118/7cba2f10/attachment.html>
More information about the Replicant
mailing list