[Debtorrent-commits] r91 - /debtorrent/branches/hippy/DebTorrent/BT1/makemetafile.py

camrdale-guest at users.alioth.debian.org camrdale-guest at users.alioth.debian.org
Tue Jun 5 01:21:10 UTC 2007


Author: camrdale-guest
Date: Tue Jun  5 01:21:10 2007
New Revision: 91

URL: http://svn.debian.org/wsvn/debtorrent/?sc=1&rev=91
Log:
Remove some no longer used parameters.

Modified:
    debtorrent/branches/hippy/DebTorrent/BT1/makemetafile.py

Modified: debtorrent/branches/hippy/DebTorrent/BT1/makemetafile.py
URL: http://svn.debian.org/wsvn/debtorrent/debtorrent/branches/hippy/DebTorrent/BT1/makemetafile.py?rev=91&op=diff
==============================================================================
--- debtorrent/branches/hippy/DebTorrent/BT1/makemetafile.py (original)
+++ debtorrent/branches/hippy/DebTorrent/BT1/makemetafile.py Tue Jun  5 01:21:10 2007
@@ -82,8 +82,7 @@
         raise UnicodeError('bad filename: '+s)
     return s.encode('utf-8')
 
-def make_meta_file(file, url, params = {}, flag = Event(),
-                   progress = lambda x: None, progress_percent = 1):
+def make_meta_file(file, url, params = {}, progress = lambda x: None):
     if params.has_key('piece_size_pow2'):
         piece_len_exp = params['piece_size_pow2']
     else:
@@ -171,11 +170,8 @@
     if not sub_pieces:
         print 'WARNING: Pieces file could not be found, not using sub-package pieces.'
         
-    info = makeinfo(file, piece_length, encoding, flag, progress, progress_percent,
-                    sub_pieces)
-    
-    if flag.isSet():
-        return
+    info = makeinfo(file, piece_length, encoding, progress, sub_pieces)
+    
     check_info(info)
     h = open(f, 'wb')
     data = {'info': info, 'announce': strip(url), 
@@ -235,8 +231,7 @@
             p[2].append(int(line[42:]))
     return pieces
 
-def makeinfo(file, piece_length, encoding, flag, progress, progress_percent=1,
-             sub_pieces = {}):
+def makeinfo(file, piece_length, encoding, progress, sub_pieces = {}):
     file = abspath(file)
     pieces = []
     lengths = []
@@ -289,8 +284,7 @@
     return r
 
 
-def completedir(dir, url, params = {}, flag = Event(),
-                vc = lambda x: None, fc = lambda x: None):
+def completedir(dir, url, params = {}, vc = lambda x: None, fc = lambda x: None):
     files = listdir(dir)
     files.sort()
     ext = '.dtorrent'
@@ -311,6 +305,6 @@
             if t not in ignore and t[0] != '.':
                 if target != '':
                     params['target'] = join(target,t+ext)
-                make_meta_file(i, url, params, flag, progress = vc, progress_percent = 0)
+                make_meta_file(i, url, params, progress = vc)
         except ValueError:
             print_exc()




More information about the Debtorrent-commits mailing list