From 5f0f7204a8e195d5470f0dfa910e89220c72dbe2 Mon Sep 17 00:00:00 2001 From: Nick Lanham Date: Wed, 23 Feb 2011 16:15:34 +0100 Subject: [PATCH] don't use libtorrent anymore in add --- deluge/ui/console/modes/add_util.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/deluge/ui/console/modes/add_util.py b/deluge/ui/console/modes/add_util.py index 02c084d47..168a6b1eb 100644 --- a/deluge/ui/console/modes/add_util.py +++ b/deluge/ui/console/modes/add_util.py @@ -36,21 +36,14 @@ # statement from all source files in the program, then also delete it here. # # -from twisted.internet import defer - from deluge.ui.client import client import deluge.component as component +from deluge.ui.common import TorrentInfo import deluge.common -from optparse import make_option import os,base64,glob -try: - import libtorrent - add_get_info = libtorrent.torrent_info -except: - import deluge.ui.common - add_get_info = deluge.ui.common.TorrentInfo + def add_torrent(t_file, options, success_cb, fail_cb, ress): t_options = {} @@ -82,7 +75,7 @@ def add_torrent(t_file, options, success_cb, fail_cb, ress): continue try: - add_get_info(f) + TorrentInfo(f) except Exception as e: fail_cb(e.message,f,ress) continue