From 5af57490650104b0f46a09b11e520cafa60ff207 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Thu, 23 Oct 2008 13:47:20 +0000 Subject: [PATCH] Allow the creation of .torrent files with no trackers --- deluge/metafile.py | 4 +++- deluge/ui/gtkui/createtorrentdialog.py | 9 +++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/deluge/metafile.py b/deluge/metafile.py index 120a40a99..ee203aae3 100644 --- a/deluge/metafile.py +++ b/deluge/metafile.py @@ -76,7 +76,9 @@ def make_meta_file(path, url, piece_length, progress=dummy, title=None, comment=None, safe=None, content_type=None, target=None, url_list=None, name=None, private=False, created_by=None, httpseeds=None): - data = {'announce': url.strip(), 'creation date': int(gmtime())} + data = {'creation date': int(gmtime())} + if url: + data['announce'] = url.strip() a, b = os.path.split(path) if not target: if b == '': diff --git a/deluge/ui/gtkui/createtorrentdialog.py b/deluge/ui/gtkui/createtorrentdialog.py index 3e9afb5f9..418266db2 100644 --- a/deluge/ui/gtkui/createtorrentdialog.py +++ b/deluge/ui/gtkui/createtorrentdialog.py @@ -256,8 +256,9 @@ class CreateTorrentDialog: # Get a list of trackers trackers = [t[1] for t in self.trackers_liststore] if len(trackers) == 0: - self.dialog.destroy() - return + tracker = None + else: + tracker = trackers[0] # Get a list of webseeds webseeds = [] b = self.glade.get_widget("textview_webseeds").get_buffer() @@ -279,7 +280,7 @@ class CreateTorrentDialog: if is_remote: client.create_torrent( path, - trackers[0], + tracker, piece_length, comment, result, @@ -298,7 +299,7 @@ class CreateTorrentDialog: threading.Thread(target=self.create_torrent, args=( path, - trackers[0], + tracker, piece_length, self._on_create_torrent_progress, comment,