Skip to content

Commit

Permalink
Remove (FIXED) and (FIX) from names when pasting
Browse files Browse the repository at this point in the history
  • Loading branch information
kfsone committed Feb 22, 2015
1 parent bed80eb commit 6cbfdf7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions misc/clipboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())

Expand Down

0 comments on commit 6cbfdf7

Please sign in to comment.