From 20887b71c994d475fdbe4a66991ff8f27b41ae43 Mon Sep 17 00:00:00 2001 From: Pavel 'LEdoian' Turinsky Date: Mon, 4 May 2020 23:01:33 +0200 Subject: [PATCH] Allow editing out the user --- markdownrunner.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/markdownrunner.py b/markdownrunner.py index 93ac0be..9a0d835 100755 --- a/markdownrunner.py +++ b/markdownrunner.py @@ -142,10 +142,11 @@ def user_action(hunk: Sequence[Command], context=None) -> Sequence[Command]: tmpfile.file.seek(0) new_hunk = [] for line in tmpfile.file.readlines(): - line = line.strip() if line == '': continue parts = line.split('\t', maxsplit=2) + # Change user to None if it is not specified + parts[0] = parts[0].strip() if parts[0].strip() != '' else None # Change directory to None if it is not specified parts[1] = parts[1].strip() if parts[1].strip() != '' else None new_hunk.append(Command(user=parts[0],directory=parts[1],command=parts[2],context=None))