]> git.ipfire.org Git - ipfire.org.git/commitdiff
Fix torrent site.
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 30 Aug 2009 19:27:32 +0000 (21:27 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 30 Aug 2009 19:27:32 +0000 (21:27 +0200)
www/pages/torrent/__init__.py

index 3490bc780514bf088bbaf75fdf7b76b0d1205df1..112e63b7bd241eaca9540f1b1080934cf9d8a222 100644 (file)
@@ -9,6 +9,7 @@ import urllib2
 
 from client.bencode import bencode, bdecode
 import web
+import web.elements
 
 class TrackerInfo:
        def __init__(self, url):
@@ -58,9 +59,9 @@ for file in os.listdir(TORRENT_BASE):
 
 tracker = TrackerInfo(TRACKER_URL)
 
-class TorrentBox(web.Box):
+class TorrentBox(web.elements.Box):
        def __init__(self, file):
-               web.Box.__init__(self, file.name, file.get_hash())
+               web.elements.Box.__init__(self, file.name, file.get_hash())
                self.w("""
                        <p>
                                <strong>Seeders:</strong> %s<br />
@@ -73,8 +74,8 @@ class TorrentBox(web.Box):
                
 
 class Content(web.Content):
-       def __init__(self, name):
-               web.Content.__init__(self, name)
+       def __init__(self):
+               web.Content.__init__(self)
        
        def content(self):
                self.w("<h3>IPFire Torrent Tracker</h3>")
@@ -82,4 +83,6 @@ class Content(web.Content):
                        b = TorrentBox(t)
                        self.w(b())
 
-Sidebar = web.Sidebar
+page = web.Page()
+page.content = Content()
+page.sidebar = web.elements.Sidebar()