From 5185bcb6a77db36ad4c054b6df8e9801db4c1405 Mon Sep 17 00:00:00 2001 From: Benjamin Loison Date: Fri, 28 Jul 2023 14:52:41 +0200 Subject: [PATCH] Replace `"\n"` with `n` in Python scripts --- scripts/findLatestTreatedCommentsForChannelsBeingTreated.py | 2 +- website/search.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/findLatestTreatedCommentsForChannelsBeingTreated.py b/scripts/findLatestTreatedCommentsForChannelsBeingTreated.py index 7c1f5a4..0dc2031 100755 --- a/scripts/findLatestTreatedCommentsForChannelsBeingTreated.py +++ b/scripts/findLatestTreatedCommentsForChannelsBeingTreated.py @@ -19,7 +19,7 @@ for channelId in list(os.walk('.'))[1]: filePath = f'{channelId}/requests/{str(numberOfRequests - 1)}.json' with open(filePath) as f: print(filePath) - #content = "\n".join(f.read().splitlines()[1:]) + #content = '\n'.join(f.read().splitlines()[1:]) data = json.load(f)#json.loads(content) snippet = data['items'][-1]['snippet'] if 'topLevelComment' in snippet: diff --git a/website/search.py b/website/search.py index 6d7319a..7cd7c55 100755 --- a/website/search.py +++ b/website/search.py @@ -27,7 +27,7 @@ def write(s): read = f.read() # We are appening content, as we moved in-file cursor. if read != '': - f.write("\n") + f.write('\n') f.write(s) f.flush() fcntl.flock(f, fcntl.LOCK_UN)