Code: Select all
non_remote_items = [
#"menuitem_open_folder",
"separator4"
]
<...>
def on_menuitem_open_folder_activate(self, data=None):
log.debug("on_menuitem_open_folder")
def _on_torrent_status(status):
# deluge.common.open_file(status["save_path"])
import os, sys, subprocess
path_matches = {"/shares/Public": "Z:"}
path = os.path.join(status["save_path"], status["name"])
for i in path_matches:
if path.startswith(i):
path = os.path.normpath(os.path.join(path_matches[i], path[len(i):]))
break
subprocess.Popen("explorer /select,"+path.encode(sys.getfilesystemencoding()))
for torrent_id in component.get("TorrentView").get_selected_torrents():
component.get("SessionProxy").get_torrent_status(torrent_id, ["save_path", "name"]).addCallback(_on_torrent_status)