From 6cbfdf7b5c97a1eae87e92030ceace12e805dd3e Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Sun, 22 Feb 2015 13:03:41 -0800 Subject: [PATCH] Remove (FIXED) and (FIX) from names when pasting --- misc/clipboard.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/misc/clipboard.py b/misc/clipboard.py index 206e1e6d..19690263 100644 --- a/misc/clipboard.py +++ b/misc/clipboard.py @@ -21,8 +21,16 @@ def __init__(self): self.tkroot = Tk() self.tkroot.withdraw() + def strip(self, text, trailing): + if text.endswith(trailing): + text = text[:-len(trailing)].strip() + return text + def copy_text(self, text): """ Copies the specified text into the clipboard. """ + text = text.strip() + text = self.strip(text, "(FIX)") + text = self.strip(text, "(FIXED)") self.tkroot.clipboard_clear() self.tkroot.clipboard_append(text.lower())