[Debtorrent-commits] r77 - in /debtorrent/branches/http-listen: DebTorrent/BT1/HTTPDownloader.py DebTorrent/BT1/makemetafile.py DebTorrent/download_bt1.py btsethttpseeds.py btshowmetainfo.py

camrdale-guest at users.alioth.debian.org camrdale-guest at users.alioth.debian.org
Sat Jun 2 02:08:32 UTC 2007


Author: camrdale-guest
Date: Sat Jun  2 02:08:32 2007
New Revision: 77

URL: http://svn.debian.org/wsvn/debtorrent/?sc=1&rev=77
Log:
Rename the http-seeds to deb_mirrors

Modified:
    debtorrent/branches/http-listen/DebTorrent/BT1/HTTPDownloader.py
    debtorrent/branches/http-listen/DebTorrent/BT1/makemetafile.py
    debtorrent/branches/http-listen/DebTorrent/download_bt1.py
    debtorrent/branches/http-listen/btsethttpseeds.py
    debtorrent/branches/http-listen/btshowmetainfo.py

Modified: debtorrent/branches/http-listen/DebTorrent/BT1/HTTPDownloader.py
URL: http://svn.debian.org/wsvn/debtorrent/debtorrent/branches/http-listen/DebTorrent/BT1/HTTPDownloader.py?rev=77&op=diff
==============================================================================
--- debtorrent/branches/http-listen/DebTorrent/BT1/HTTPDownloader.py (original)
+++ debtorrent/branches/http-listen/DebTorrent/BT1/HTTPDownloader.py Sat Jun  2 02:08:32 2007
@@ -280,7 +280,7 @@
             except:
                 pass
             return False
-        if self.connection_status != 200:
+        if self.connection_status != 206:
             self.errorcount += 1
             return False
         self._retry_period = 1

Modified: debtorrent/branches/http-listen/DebTorrent/BT1/makemetafile.py
URL: http://svn.debian.org/wsvn/debtorrent/debtorrent/branches/http-listen/DebTorrent/BT1/makemetafile.py?rev=77&op=diff
==============================================================================
--- debtorrent/branches/http-listen/DebTorrent/BT1/makemetafile.py (original)
+++ debtorrent/branches/http-listen/DebTorrent/BT1/makemetafile.py Sat Jun  2 02:08:32 2007
@@ -26,8 +26,8 @@
 defaults = [
     ('announce_list', '',
         'a list of announce URLs - explained below'),
-    ('httpseeds', '',
-        'a list of http seed URLs - explained below'),
+    ('deb_mirrors', '',
+        'a list of mirror URLs - explained below'),
     ('piece_size_pow2', 0,
         "which power of 2 to set the piece size to (0 = automatic)"),
     ('comment', '',
@@ -59,7 +59,7 @@
     print ('                http://tracker1.com|http://backup1.com,http://backup2.com')
     print ('                     (tries tracker 1 first, then tries between the 2 backups randomly)')
     print ('')
-    print ('    httpseeds = optional list of http-seed URLs, in the format:')
+    print ('    deb_mirrors = optional list of mirror URLs, in the format:')
     print ('            url[|url...]')
     
 def uniconvertl(l, e):
@@ -139,10 +139,10 @@
             l.append(tier.split(','))
         data['announce-list'] = l
         
-    if params.has_key('real_httpseeds'):    # shortcut for progs calling in from outside
-        data['httpseeds'] = params['real_httpseeds']
-    elif params.has_key('httpseeds') and params['httpseeds']:
-        data['httpseeds'] = params['httpseeds'].split('|')
+    if params.has_key('real_deb_mirrors'):    # shortcut for progs calling in from outside
+        data['deb_mirrors'] = params['real_deb_mirrors']
+    elif params.has_key('deb_mirrors') and params['deb_mirrors']:
+        data['deb_mirrors'] = params['deb_mirrors'].split('|')
         
     h.write(bencode(data))
     h.close()

Modified: debtorrent/branches/http-listen/DebTorrent/download_bt1.py
URL: http://svn.debian.org/wsvn/debtorrent/debtorrent/branches/http-listen/DebTorrent/download_bt1.py?rev=77&op=diff
==============================================================================
--- debtorrent/branches/http-listen/DebTorrent/download_bt1.py (original)
+++ debtorrent/branches/http-listen/DebTorrent/download_bt1.py Sat Jun  2 02:08:32 2007
@@ -1118,8 +1118,8 @@
             self.rawserver, self.finflag, self.errorfunc, self.downloader,
             self.config['max_rate_period'], self.infohash, self._received_http_data,
             self.connecter.got_piece)
-        if self.response.has_key('httpseeds') and not self.finflag.isSet():
-            for u in self.response['httpseeds']:
+        if self.response.has_key('deb_mirrors') and not self.finflag.isSet():
+            for u in self.response['deb_mirrors']:
                 self.httpdownloader.make_download(u)
 
         if self.selector_enabled:

Modified: debtorrent/branches/http-listen/btsethttpseeds.py
URL: http://svn.debian.org/wsvn/debtorrent/debtorrent/branches/http-listen/btsethttpseeds.py?rev=77&op=diff
==============================================================================
--- debtorrent/branches/http-listen/btsethttpseeds.py (original)
+++ debtorrent/branches/http-listen/btsethttpseeds.py Sat Jun  2 02:08:32 2007
@@ -7,7 +7,7 @@
 #
 # $Id$
 
-"""Change the http-seeds info in the metainfo file."""
+"""Change the deb_mirrors info in the metainfo file."""
 
 from sys import argv,exit
 from os.path import split
@@ -15,12 +15,12 @@
 
 if len(argv) < 3:
     a,b = split(argv[0])
-    print ('Usage: ' + b + ' <http-seeds> file1.torrent [file2.torrent...]')
+    print ('Usage: ' + b + ' <deb_mirrors> file1.torrent [file2.torrent...]')
     print ('')
     print ('  Where:')
-    print ('    http-seeds = list of seed URLs, in the format:')
+    print ('    deb_mirrors = list of mirror URLs, in the format:')
     print ('           url[|url...] or 0')
-    print ('                if the list is a zero, any http seeds will be stripped.')
+    print ('                if the list is a zero, any existing mirrors will be stripped.')
     print ('')
     exit(2) # common exit code for syntax error
 
@@ -34,19 +34,19 @@
     h = open(f, 'rb')
     metainfo = bdecode(h.read())
     h.close()
-    if metainfo.has_key('httpseeds'):
+    if metainfo.has_key('deb_mirrors'):
         list = []
-        for url in metainfo['httpseeds']:
+        for url in metainfo['deb_mirrors']:
             list += [url,'|']
         del list[-1]
         liststring = ''
         for i in list:
             liststring += i
-        print 'old http-seed list for %s: %s' % (f, liststring)
+        print 'old deb_mirrors list for %s: %s' % (f, liststring)
         if not seedlist:
-            del metainfo['httpseeds']
+            del metainfo['deb_mirrors']
     if seedlist:
-        metainfo['httpseeds'] = seedlist
+        metainfo['deb_mirrors'] = seedlist
 
     h = open(f, 'wb')
     h.write(bencode(metainfo))

Modified: debtorrent/branches/http-listen/btshowmetainfo.py
URL: http://svn.debian.org/wsvn/debtorrent/debtorrent/branches/http-listen/btshowmetainfo.py?rev=77&op=diff
==============================================================================
--- debtorrent/branches/http-listen/btshowmetainfo.py (original)
+++ debtorrent/branches/http-listen/btshowmetainfo.py Sat Jun  2 02:08:32 2007
@@ -67,14 +67,14 @@
         for i in list:
             liststring+=i
         print 'announce-list.: %s' % liststring
-    if metainfo.has_key('httpseeds'):
+    if metainfo.has_key('deb_mirrors'):
         list = []
-        for seed in metainfo['httpseeds']:
+        for seed in metainfo['deb_mirrors']:
             list += [seed,'|']
         del list[-1]
         liststring = ''
         for i in list:
             liststring+=i
-        print 'http seeds....: %s' % liststring
+        print 'mirror URLs....: %s' % liststring
     if metainfo.has_key('comment'):
         print 'comment.......: %s' % metainfo['comment']




More information about the Debtorrent-commits mailing list