def querySearchLost(client, src_dir_path, data_dir_path): data_dir_path = os.path.abspath(data_dir_path) if client != None: torrents_tree_set = set(clientlib.indexed(client, True)) else: torrents_tree_set = set(tfile.indexed(src_dir_path, data_dir_path).keys()) data_tree_set = set(fs.treeList(data_dir_path)) for file_path in sorted(data_tree_set.difference(torrents_tree_set)): print file_path
def queryConflicts(client, src_dir_path): if client != None: files_dict = clientlib.indexed(client, True) else: files_dict = tfile.indexed(src_dir_path) for (full_path, torrents_set) in files_dict.iteritems(): if len(torrents_set) > 1: print full_path for torrent in torrents_set: print "\t" + formatTorrent(client, torrent)
def queryWhatProvides(client, src_dir_path, data_dir_path, file_path): data_dir_path = os.path.abspath(data_dir_path) if not data_dir_path is None else "" system_path_flag = os.path.isabs(file_path) if not data_dir_path is None and not system_path_flag: file_path = os.path.join(data_dir_path, file_path) if client != None: files_dict = clientlib.indexed(client, system_path_flag) else: files_dict = tfile.indexed(src_dir_path, data_dir_path) if files_dict.has_key(file_path): for torrent in files_dict[file_path]: print formatTorrent(client, torrent)