[kupfer] plugin.fileactions: Return moved file with MoveTo



commit 35653e1c6d625947f83b5b838fcb6cf8faba518d
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Wed Sep 9 19:32:51 2009 +0200

    plugin.fileactions: Return moved file with MoveTo

 kupfer/plugin/fileactions.py |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/kupfer/plugin/fileactions.py b/kupfer/plugin/fileactions.py
index af4c239..29919f5 100644
--- a/kupfer/plugin/fileactions.py
+++ b/kupfer/plugin/fileactions.py
@@ -81,6 +81,8 @@ def _good_destination(dpath, spath):
 class MoveTo (Action, pretty.OutputMixin):
 	def __init__(self):
 		Action.__init__(self, _("Move To..."))
+	def has_result(self):
+		return True
 	def activate(self, leaf, obj):
 		sfile = gio.File(leaf.object)
 		bname = sfile.get_basename()
@@ -90,6 +92,8 @@ class MoveTo (Action, pretty.OutputMixin):
 			self.output_debug("Move %s to %s (ret: %s)" % (sfile, dfile, ret))
 		except gio.Error, exc:
 			self.output_error("Move %s to %s Error: %s" % (sfile, dfile, exc))
+		else:
+			return FileLeaf(dfile.get_path())
 
 	def valid_for_item(self, item):
 		return os.access(item.object, os.R_OK | os.W_OK)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]