aboutsummaryrefslogtreecommitdiff
path: root/net-p2p
diff options
context:
space:
mode:
authorMario Sergio Fujikawa Ferreira <lioux@FreeBSD.org>2005-01-08 20:28:03 +0000
committerMario Sergio Fujikawa Ferreira <lioux@FreeBSD.org>2005-01-08 20:28:03 +0000
commitd75a721dfded2295b89c0b490169a9b9330f6d02 (patch)
tree6e7a6e0163e11c3d9066aba0219a9f1b88365b53 /net-p2p
parent70b019a13ece172ae272d9ddb81d1214058c5ad4 (diff)
downloadports-d75a721dfded2295b89c0b490169a9b9330f6d02.tar.gz
ports-d75a721dfded2295b89c0b490169a9b9330f6d02.zip
Notes
Diffstat (limited to 'net-p2p')
-rw-r--r--net-p2p/py-bittorrent-devel/Makefile4
-rw-r--r--net-p2p/py-bittorrent-devel/files/patch-btdownloadgui.py122
2 files changed, 124 insertions, 2 deletions
diff --git a/net-p2p/py-bittorrent-devel/Makefile b/net-p2p/py-bittorrent-devel/Makefile
index 818fbc5b1bd7..c50233f19196 100644
--- a/net-p2p/py-bittorrent-devel/Makefile
+++ b/net-p2p/py-bittorrent-devel/Makefile
@@ -7,7 +7,7 @@
PORTNAME= BitTorrent
PORTVERSION= 3.9.0
-PORTREVISION= 3
+PORTREVISION= 4
PORTEPOCH= 1
CATEGORIES?= net python
MASTER_SITES= http://www.bittorrent.com/
@@ -40,7 +40,7 @@ PLIST_SUB+= PORTVERSION=${PORTVERSION}
# required for GUI
.ifndef(WITHOUT_GUI)
-RUN_DEPENDS+= ${PYTHON_SITELIBDIR}/wxPython/__init__.py:${PORTSDIR}/x11-toolkits/py-wxPython
+RUN_DEPENDS+= ${PYTHON_SITELIBDIR}/pygtk.py:${PORTSDIR}/x11-toolkits/py-gtk2
PLIST_FILES+= \
bin/btmaketorrentgui.py \
diff --git a/net-p2p/py-bittorrent-devel/files/patch-btdownloadgui.py b/net-p2p/py-bittorrent-devel/files/patch-btdownloadgui.py
new file mode 100644
index 000000000000..870a630e2a21
--- /dev/null
+++ b/net-p2p/py-bittorrent-devel/files/patch-btdownloadgui.py
@@ -0,0 +1,122 @@
+--- btdownloadgui.py.orig Mon Dec 20 20:39:15 2004
++++ btdownloadgui.py Sat Jan 8 15:16:14 2005
+@@ -1507,33 +1507,44 @@
+
+ if advanced_ui:
+ self.extrabox = gtk.VBox(homogeneous=False)
+-
+- self.table = gtk.Table(2, 7, False)
+- self.labels = []
+- lnames = ('peers','seeds','distr','up curr.','down curr.','up prev.','down prev.')
++ #self.extrabox = self.vbox
++
++ self.up_curr = FancyLabel('Current up: %s' , 0)
++ self.down_curr = FancyLabel('Current down: %s', 0)
++ self.curr_box = gtk.HBox(homogeneous=True)
++ self.curr_box.pack_start(lalign(self.up_curr ), expand=True, fill=True)
++ self.curr_box.pack_start(lalign(self.down_curr), expand=True, fill=True)
++ self.extrabox.pack_start(self.curr_box)
+
+- for i, name in enumerate(lnames):
+- label = gtk.Label(name)
+- self.table.attach(label, i, i+1, 0, 1, xpadding = SPACING)
+- label = gtk.Label('-')
+- self.labels.append(label)
+- self.table.attach(label, i, i+1, 1, 2, xpadding = SPACING)
+- self.extrabox.pack_start(self.table)
++ self.up_prev = FancyLabel('Previous up: %s' , 0)
++ self.down_prev = FancyLabel('Previous down: %s' , 0)
++ self.prev_box = gtk.HBox(homogeneous=True)
++ self.prev_box.pack_start(lalign(self.up_prev ), expand=True, fill=True)
++ self.prev_box.pack_start(lalign(self.down_prev), expand=True, fill=True)
++ self.extrabox.pack_start(self.prev_box)
++
++ self.share_ratio = FancyLabel('Share ratio: %0.02f%%', 0)
++ self.extrabox.pack_start(lalign(self.share_ratio))
++
++ self.peer_info = FancyLabel('%s peers, %s seeds',0,0)
++ self.extrabox.pack_start(lalign(self.peer_info))
+
+- # extra info
+- self.elabels = []
+- for i in range(4):
+- label = gtk.Label('-')
+- self.extrabox.pack_start(lalign(label))
+- self.elabels.append(label)
++ self.dist_copies = FancyLabel('Distributed copies: %d; Next: %s', 0, '')
++ self.extrabox.pack_start(lalign(self.dist_copies))
++
++ self.piece_info = FancyLabel('Pieces: %d total, %d complete, %d partial, %d active (%d empty)', *(0,)*5)
++ self.extrabox.pack_start(lalign(self.piece_info))
++
++ self.bad_info = FancyLabel('%d bad pieces + %s in discarded requests', 0, 0)
++ self.extrabox.pack_start(lalign(self.bad_info))
+
++ # extra info
++
+ pl = self.metainfo.piece_length
+ tl = self.metainfo.total_bytes
+ count, lastlen = divmod(tl, pl)
+ self.piece_count = count + (lastlen > 0)
+
+- self.elabels[0].set_text("Share ratio: -")
+-
+ self.infobox.pack_end(self.extrabox, expand=False, fill=False)
+
+
+@@ -1649,31 +1660,34 @@
+ Rate(statistics['upRate']))
+
+ if advanced_ui:
+- self.labels[0].set_text(str(statistics['numPeers']))
++ if self.up_down_ratio is not None:
++ self.share_ratio.set_value(self.up_down_ratio*100)
++
++ num_seeds = statistics['numSeeds']
+ if self.seed:
+- statistics['numOldSeeds'] = 0 # !@# XXX
+- self.labels[1].set_text('(%d)' % statistics['numOldSeeds'])
+- else:
+- self.labels[1].set_text(str(statistics['numSeeds']))
+- self.labels[2].set_text(str(statistics['numCopies']))
+- self.labels[3].set_text(str(Size(statistics['upTotal'])))
+- self.labels[4].set_text(str(Size(statistics['downTotal'])))
+- self.labels[5].set_text(str(Size(self.uptotal)))
+- self.labels[6].set_text(str(Size(self.downtotal)))
++ num_seeds = statistics['numOldSeeds'] = 0 # !@# XXX
++
++ self.peer_info.set_value(statistics['numPeers' ],
++ num_seeds)
++ #statistics['numCopies'], )
++
++ self.up_curr.set_value(str(Size(statistics['upTotal'])))
++ self.down_curr.set_value(str(Size(statistics['downTotal'])))
++
++ self.up_prev.set_value(str(Size(self.uptotal)))
++ self.down_prev.set_value(str(Size(self.downtotal)))
+
+- if advanced_ui:
+ # refresh extra info
+- if self.up_down_ratio is not None:
+- self.elabels[0].set_text('Share ratio: %.2f%%' % (self.up_down_ratio*100))
+- self.elabels[1].set_text('Pieces: %d total, %d complete, %d partial, %d active (%d empty)'
+- % (self.piece_count ,
+- statistics['storage_numcomplete'],
+- statistics['storage_dirty'],
+- statistics['storage_active'],
+- statistics['storage_new']))
+- self.elabels[2].set_text('Next distributed copies: ' + ', '.join(["%d:%.1f%%" % (a, int(b*1000)/10) for a, b in zip(itertools.count(int(statistics['numCopies']+1)), statistics['numCopyList'])]))
+- self.elabels[3].set_text('%d bad pieces + %s in discarded requests' % (statistics['storage_numflunked'], Size(statistics['discarded'])))
++ self.piece_info.set_value(self.piece_count,
++ statistics['storage_numcomplete'],
++ statistics['storage_dirty'],
++ statistics['storage_active'],
++ statistics['storage_new'] )
+
++ self.dist_copies.set_value( statistics['numCopies'], ', '.join(["%d:%.1f%%" % (a, int(b*1000)/10) for a, b in zip(itertools.count(int(statistics['numCopies']+1)), statistics['numCopyList'])]))
++
++ self.bad_info.set_value(statistics['storage_numflunked'], Size(statistics['discarded']))
++
+ if self.peerlistwindow is not None:
+ spew = statistics.get('spew')
+ if spew is not None: