From 35b542cc7f308c885e95fdbebbd1604b7325a759 Mon Sep 17 00:00:00 2001 From: James Date: Thu, 3 Feb 2022 18:29:08 +0000 Subject: [PATCH] Strip ID --- rf2/setup_server.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/rf2/setup_server.py b/rf2/setup_server.py index 9a6395c..23ad9df 100644 --- a/rf2/setup_server.py +++ b/rf2/setup_server.py @@ -130,17 +130,18 @@ def read_workshop(content_file: str) -> tuple: with open(content_file, "rt") as content: content_ids = content.readlines() for content_id in content_ids: - if content_id.strip() == "": + stripped_id = content_id.strip() + if stripped_id == "": break - if not content_id.isnumeric(): - print(f"Error: Invalid content ID '{content_id}', all IDs should be numeric!") + if not stripped_id.isnumeric(): + print(f"Error: Invalid content ID '{stripped_id}', all IDs should be numeric!") return (False, []) - if content_id in SERVER_SETUP_CONTENT: + if stripped_id in SERVER_SETUP_CONTENT: continue - out_content.append(content_id) + out_content.append(stripped_id) print(f"Found {len(out_content)} content IDs")