aboutsummaryrefslogtreecommitdiff
path: root/edit.py
diff options
context:
space:
mode:
authorKeith Smiley <keithbsmiley@gmail.com>2015-10-18 19:33:57 -0700
committerKeith Smiley <keithbsmiley@gmail.com>2015-10-18 19:33:57 -0700
commit14503786d1ff3a91cee1b05698faf60e1f7bb371 (patch)
treedb01d3ae91e1dfcc6d3e7feae52aec65494b2ce4 /edit.py
parentf49e630c1dbe009abec2d1dc5d35e7cae3a77e7b (diff)
downloadedit-14503786d1ff3a91cee1b05698faf60e1f7bb371.tar.gz
edit-14503786d1ff3a91cee1b05698faf60e1f7bb371.zip
Remove file after using it
Diffstat (limited to 'edit.py')
-rw-r--r--edit.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/edit.py b/edit.py
index 42f966f..40c3653 100644
--- a/edit.py
+++ b/edit.py
@@ -21,6 +21,7 @@ def edit(data, buf, args):
cmd = [editor, path]
code = subprocess.Popen(cmd).wait()
if code != 0:
+ os.remove(path)
weechat.command(buf, "/window refresh")
return weechat.WEECHAT_RC_ERROR
@@ -29,6 +30,7 @@ def edit(data, buf, args):
weechat.buffer_set(buf, "input", text)
weechat.buffer_set(buf, "input_pos", str(len(text)))
+ os.remove(path)
weechat.command(buf, "/window refresh")
return weechat.WEECHAT_RC_OK