1234567891011121314151617181920212223242526272829303132333435 |
- #! /usr/bin/env python
-
- import sys
- import time
- import torrentfile
- import torrenttracker
- import torrentmanager
- import config
-
- if len(sys.argv) >= 2:
- config = config.Config(sys.argv[1])
- else:
- config = config.Config()
-
- maxRatio = config.getMaxRatio()
- maxRate = config.getMaxRatio()
-
- trackers = []
- for file in ('torrent.torrent', 'torrent2.torrent'):
- torrent = torrentfile.TorrentFile()
- torrent.readFile(file)
- trackers.append(torrent)
-
- manager = torrentmanager.TorrentManager(trackers)
- manager.start()
- run = True
- while run:
- t = manager.getNextTime()
- torrent = t['torrent']
- secs = t['time']
- print(torrent.getName() + ": Next update in " + str(secs) + " seconds")
- time.sleep(secs)
- print("Updating...")
- manager.updateNextTracker()
|