You can subscribe to this list here.
2003 |
Jan
|
Feb
(20) |
Mar
(122) |
Apr
(16) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <sir...@us...> - 2003-03-31 14:16:21
|
Update of /cvsroot/btplusplus/BT++/src/DlgAddTor In directory sc8-pr-cvs1:/tmp/cvs-serv19487/src/DlgAddTor Modified Files: DlgAddTor.py Log Message: - Fixed core bug. - Modified 'AddTorrent' downloading. - History shows uploaded (transfered) MB. - Fixed bug in right-click-menu of the history tab. - Corrected some of the grid info display. Index: DlgAddTor.py =================================================================== RCS file: /cvsroot/btplusplus/BT++/src/DlgAddTor/DlgAddTor.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** DlgAddTor.py 28 Mar 2003 14:47:26 -0000 1.3 --- DlgAddTor.py 31 Mar 2003 14:15:27 -0000 1.4 *************** *** 5,8 **** --- 5,9 ---- from urlparse import urlparse from urllib import urlopen, unquote + from threading import Thread class DlgAddTor(wxDialog): *************** *** 64,105 **** elif self.UrlRadio.GetValue() == true: ! url = self.UrlText.GetLabel() - if url != '': ! try: ! while(1): ! url = unquote(url) ! if url == unquote(url): ! break ! h = urlopen(url) ! if url.startswith('http'): ! i = str(h.info()) ! s = i.find('filename') + 9 ! e = i.find('\n', s) - 1 ! if s == 8: ! spl = urlparse(url) ! file = path.split(spl[2])[1] ! else: ! file = i[s:e] ! else: ! spl = urlparse(url) ! file = path.split(spl[2])[1] ! if file == '': ! raise ! ! data = h.read() ! h.close() ! f = open( path.join(Config.Get('Paths', 'Torrent'), file), 'wb' ) ! f.write( data ) ! f.close() ! except: ! wxMessageBox("Couldn't download the torrent to the BT++ torrent directory.") ! self.EndModal(0) --- 65,113 ---- elif self.UrlRadio.GetValue() == true: ! url = self.UrlText.GetLabel() if url != '': ! thr = Thread( target = DownloadTorrent, args=[url] ) ! thr.setDaemon(false) ! thr.start() ! else: ! wxMessageBox("Couldn't download the torrent to the BT++ torrent directory.") ! ! self.EndModal(0) ! ! def DownloadTorrent(url): ! try: ! while(1): ! url = unquote(url) ! if url == unquote(url): ! break ! h = urlopen(url) ! if url.startswith('http'): ! i = str(h.info()) ! s = i.find('filename') + 9 ! e = i.find('\n', s) - 1 ! if s == 8: ! spl = urlparse(url) ! file = path.split(spl[2])[1] ! else: ! file = i[s:e] ! ! else: ! spl = urlparse(url) ! file = path.split(spl[2])[1] ! if file == '': ! raise ! data = h.read() ! h.close() ! f = open( path.join(Config.Get('Paths', 'Torrent'), file), 'wb' ) ! f.write( data ) ! f.close() ! except: ! wxMessageBox("Couldn't download the torrent to the BT++ torrent directory.") |
From: <sir...@us...> - 2003-03-31 14:16:19
|
Update of /cvsroot/btplusplus/BT++/src/TabHistory In directory sc8-pr-cvs1:/tmp/cvs-serv19487/src/TabHistory Modified Files: Grid.py Log Message: - Fixed core bug. - Modified 'AddTorrent' downloading. - History shows uploaded (transfered) MB. - Fixed bug in right-click-menu of the history tab. - Corrected some of the grid info display. Index: Grid.py =================================================================== RCS file: /cvsroot/btplusplus/BT++/src/TabHistory/Grid.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Grid.py 29 Mar 2003 10:45:18 -0000 1.3 --- Grid.py 31 Mar 2003 14:15:25 -0000 1.4 *************** *** 13,16 **** --- 13,29 ---- class HistGrid(TabTrans.Grid.Grid): + Selection = { + 'Set': [], + 'Add': false + } + + LabelResize = { + 'Over': false, + 'Active': false, + 'Num': -1, + 'Start': -1, + 'PosX': -1 + } + def __init__(self, parent): wxScrolledWindow.__init__(self, parent, -1, wxPoint(0,0), wxSize(786,335), style = wxSIMPLE_BORDER | wxCLIP_CHILDREN | wxNO_FULL_REPAINT_ON_RESIZE) *************** *** 110,128 **** if col == 1: ! return '%.2f MB' % (info('Size') / 1024 / 1024) if col == 2: ! if info('Status') == 'Downloading': ! return 'Uploading' ! ! if info('FractionDone') == -1.0 or \ ! info('Status') == 'Hashing': ! return '?' ! else: ! return '%.2f MB' % (info('FractionDone') * info('Size') / 1024 / 1024) if col == 3: ! return '%.1f' % info('SpeedUp') if col == 4: ! return info('Status') --- 123,137 ---- if col == 1: ! return '%.2f MB' % (float(info('Size')) / 1024 / 1024) if col == 2: ! return '%.2f MB' % (float(info('SizeUp')) / 1024 / 1024) if col == 3: ! return '%.1f' % float(info('SpeedUp')) if col == 4: ! if info('Status') == 'Downloading': ! return 'Uploading' ! else: ! return info('Status') |
From: <sir...@us...> - 2003-03-31 14:16:13
|
Update of /cvsroot/btplusplus/BT++/src/TabTrans In directory sc8-pr-cvs1:/tmp/cvs-serv19487/src/TabTrans Modified Files: GridTable.py Log Message: - Fixed core bug. - Modified 'AddTorrent' downloading. - History shows uploaded (transfered) MB. - Fixed bug in right-click-menu of the history tab. - Corrected some of the grid info display. Index: GridTable.py =================================================================== RCS file: /cvsroot/btplusplus/BT++/src/TabTrans/GridTable.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** GridTable.py 28 Mar 2003 12:44:27 -0000 1.8 --- GridTable.py 31 Mar 2003 14:15:21 -0000 1.9 *************** *** 109,113 **** if col == 1: ! return '%.2f MB' % (info('Size') / 1024 / 1024) if col == 2: --- 109,113 ---- if col == 1: ! return '%.2f MB' % (float(info('Size')) / 1024 / 1024) if col == 2: *************** *** 117,124 **** return '?' else: ! return '%.2f MB' % (info('FractionDone') * info('Size') / 1024 / 1024) if col == 3: ! return '%.1f / %.1f' % (info('SpeedDown'), info('SpeedUp')) if col == 4: --- 117,124 ---- return '?' else: ! return '%.2f MB' % (float(info('FractionDone')) * float(info('Size')) / 1024 / 1024) if col == 3: ! return '%.1f / %.1f' % (float(info('SpeedDown')), float(info('SpeedUp'))) if col == 4: *************** *** 134,138 **** return '?' else: ! return '%.1f%% [%.2f MB]' % (info('FractionRemain') * 100, info('FractionRemain') * info('Size') / 1024 / 1024) if col == 7: --- 134,138 ---- return '?' else: ! return '%.1f%% [%.2f MB]' % (float(info('FractionRemain')) * 100, float(info('FractionRemain')) * float(info('Size')) / 1024 / 1024) if col == 7: |
From: <sir...@us...> - 2003-03-31 14:16:07
|
Update of /cvsroot/btplusplus/BT++/src In directory sc8-pr-cvs1:/tmp/cvs-serv19487/src Modified Files: LoaderManager.py Loader.py Log Message: - Fixed core bug. - Modified 'AddTorrent' downloading. - History shows uploaded (transfered) MB. - Fixed bug in right-click-menu of the history tab. - Corrected some of the grid info display. Index: LoaderManager.py =================================================================== RCS file: /cvsroot/btplusplus/BT++/src/LoaderManager.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** LoaderManager.py 30 Mar 2003 15:30:52 -0000 1.13 --- LoaderManager.py 31 Mar 2003 14:15:32 -0000 1.14 *************** *** 4,7 **** --- 4,8 ---- from BTConstants import * from core.CurrentRateMeasure import GlobalMeasure + from time import strftime class LoaderManager: Index: Loader.py =================================================================== RCS file: /cvsroot/btplusplus/BT++/src/Loader.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Loader.py 28 Mar 2003 21:09:34 -0000 1.8 --- Loader.py 31 Mar 2003 14:15:35 -0000 1.9 *************** *** 76,80 **** downRate = 0, upRate = 0, ! activity = 'Paused' ) self.Config['Tor'] = tor --- 76,82 ---- downRate = 0, upRate = 0, ! activity = 'Paused', ! up = 0, ! down = 0 ) self.Config['Tor'] = tor *************** *** 228,232 **** ########################################################################################################### ! def UpdateStatus(self, fractionDone = None, timeEst = None, downRate = None, upRate = None, activity = None): if fractionDone != None: --- 230,234 ---- ########################################################################################################### ! def UpdateStatus(self, fractionDone = None, timeEst = None, downRate = None, upRate = None, activity = None, up = None, down = None): if fractionDone != None: *************** *** 251,254 **** --- 253,262 ---- self.Info['SpeedUp'] = float(upRate) / (1 << 10) + if up != None: + self.Info['SizeUp'] = up + + if down != None: + self.Info['SizeDown'] = down + try: self.Refresh() *************** *** 524,531 **** self.FlagEnd, 2.0, # DISPLAY INTERVAL ! 0 ) # STDOUT DISPLAY self.UpdateStatus(activity = 'Downloading') ! self.Obj['Rerequester'].d(0) self.Obj['RawServer'].listen_forever( self.Obj['Encrypter'] ) --- 532,541 ---- self.FlagEnd, 2.0, # DISPLAY INTERVAL ! 0, # STDOUT DISPLAY ! self.Obj['UpMeasure'].get_total, ! self.Obj['DownMeasure'].get_total ) self.UpdateStatus(activity = 'Downloading') ! self.Obj['Rerequester'].d(0) self.Obj['RawServer'].listen_forever( self.Obj['Encrypter'] ) |
From: <sir...@us...> - 2003-03-30 15:30:56
|
Update of /cvsroot/btplusplus/BT++/src In directory sc8-pr-cvs1:/tmp/cvs-serv31705/src Modified Files: LoaderManager.py Log Message: - Fixed bug in strict hashing. Index: LoaderManager.py =================================================================== RCS file: /cvsroot/btplusplus/BT++/src/LoaderManager.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** LoaderManager.py 29 Mar 2003 15:31:54 -0000 1.12 --- LoaderManager.py 30 Mar 2003 15:30:52 -0000 1.13 *************** *** 242,246 **** and not loader.IsUserPaused() \ and not loader.IsFinished() \ ! and (hsstr == 0 or hscnt < hsmax): hscnt = hscnt - 1 dwcnt = dwcnt - 1 --- 242,246 ---- and not loader.IsUserPaused() \ and not loader.IsFinished() \ ! and (hsstr == 0 or hscnt > 0): hscnt = hscnt - 1 dwcnt = dwcnt - 1 |
From: <sir...@us...> - 2003-03-29 15:31:58
|
Update of /cvsroot/btplusplus/BT++/src In directory sc8-pr-cvs1:/tmp/cvs-serv32068/src Modified Files: LoaderManager.py ConfigFile.py Log Message: - Added strict hashing config option. - Fixed upload limit updating (after pref change). Index: LoaderManager.py =================================================================== RCS file: /cvsroot/btplusplus/BT++/src/LoaderManager.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** LoaderManager.py 29 Mar 2003 00:54:13 -0000 1.11 --- LoaderManager.py 29 Mar 2003 15:31:54 -0000 1.12 *************** *** 99,102 **** --- 99,108 ---- return self.Loaders[num] + def SetUpSpeed(self, speed): + for l in self.Loaders: + if l.Obj.has_key('Connecter'): + con = l.Obj['Connecter'] + con.max_upload_rate = speed * 1024 + ########################################################################################################### ########################################################################################################### *************** *** 221,232 **** dwsta = Config.Get('Download', 'AutoStart') dwmax = Config.Get('Download', 'MaxSimDown') if dwsta == 1 and dwcnt < dwmax: dwcnt = dwmax - dwcnt for loader in self.Loaders: if dwcnt <= 0: break ! if not loader.IsRunning() and not loader.IsUserPaused() and not loader.IsFinished(): dwcnt = dwcnt - 1 loader.StartDownload() --- 227,247 ---- dwsta = Config.Get('Download', 'AutoStart') dwmax = Config.Get('Download', 'MaxSimDown') + + hscnt = self.GetNumHashing() + hsmax = Config.Get('Hash', 'NumSimHash') + hsstr = Config.Get('Hash', 'Strict') if dwsta == 1 and dwcnt < dwmax: dwcnt = dwmax - dwcnt + hscnt = hsmax - hscnt for loader in self.Loaders: if dwcnt <= 0: break ! if not loader.IsRunning() \ ! and not loader.IsUserPaused() \ ! and not loader.IsFinished() \ ! and (hsstr == 0 or hscnt < hsmax): ! hscnt = hscnt - 1 dwcnt = dwcnt - 1 loader.StartDownload() Index: ConfigFile.py =================================================================== RCS file: /cvsroot/btplusplus/BT++/src/ConfigFile.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ConfigFile.py 28 Mar 2003 12:44:25 -0000 1.6 --- ConfigFile.py 29 Mar 2003 15:31:54 -0000 1.7 *************** *** 18,22 **** 'Hash': { 'Background': 1, ! 'NumSimHash': 1 }, 'Bind': { --- 18,23 ---- 'Hash': { 'Background': 1, ! 'NumSimHash': 1, ! 'Strict': 0 }, 'Bind': { |
From: <sir...@us...> - 2003-03-29 15:31:56
|
Update of /cvsroot/btplusplus/BT++/src/DlgPref In directory sc8-pr-cvs1:/tmp/cvs-serv32068/src/DlgPref Modified Files: DlgPref.py Log Message: - Added strict hashing config option. - Fixed upload limit updating (after pref change). Index: DlgPref.py =================================================================== RCS file: /cvsroot/btplusplus/BT++/src/DlgPref/DlgPref.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** DlgPref.py 9 Mar 2003 12:10:02 -0000 1.3 --- DlgPref.py 29 Mar 2003 15:31:54 -0000 1.4 *************** *** 4,7 **** --- 4,8 ---- from Validators import ValidatorAlpha from Controls import * + from Managers import ManagerUp,ManagerDown class DlgPref(wxDialog): *************** *** 38,41 **** --- 39,46 ---- Config.Save() + + ManagerUp .SetUpSpeed( Config.Get('Download','MaxSpeedUp') ) + ManagerDown.SetUpSpeed( Config.Get('Download','MaxSpeedUp') ) + self.EndModal(0) *************** *** 99,103 **** wxStaticBox(self, -1, 'Uploading', wxPoint(5, 92), wxSize(314,36)) wxStaticBox(self, -1, 'Transfer Limits', wxPoint(5,133), wxSize(314,41)) ! wxStaticBox(self, -1, 'Hashing', wxPoint(5,179), wxSize(314,62)) # Downloading --- 104,108 ---- wxStaticBox(self, -1, 'Uploading', wxPoint(5, 92), wxSize(314,36)) wxStaticBox(self, -1, 'Transfer Limits', wxPoint(5,133), wxSize(314,41)) ! wxStaticBox(self, -1, 'Hashing', wxPoint(5,179), wxSize(314,82)) # Downloading *************** *** 141,146 **** help = 'If checked hashing will occur as a background process.' ) PrefTextCtrl( self, ! wxPoint(10,214), wxSize(25,20), ['Hash', 'NumSimHash'], 'Max. simultaneous files hashed (1 - 5)', --- 146,157 ---- help = 'If checked hashing will occur as a background process.' ) + PrefCheckBox( self, + wxPoint(12,216), + ['Hash', 'Strict'], + 'Strict starting of hashing.', + help = 'If checked only the set number of files will be hashed, never more.' ) + PrefTextCtrl( self, ! wxPoint(10,234), wxSize(25,20), ['Hash', 'NumSimHash'], 'Max. simultaneous files hashed (1 - 5)', |
From: <bel...@us...> - 2003-03-29 11:40:18
|
Update of /cvsroot/btplusplus/BT++/src In directory sc8-pr-cvs1:/tmp/cvs-serv29969/src Modified Files: InfoManager.py Log Message: Bug fix. Still learning about python class stuff ^^' Index: InfoManager.py =================================================================== RCS file: /cvsroot/btplusplus/BT++/src/InfoManager.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** InfoManager.py 29 Mar 2003 00:54:09 -0000 1.2 --- InfoManager.py 29 Mar 2003 11:40:12 -0000 1.3 *************** *** 21,24 **** --- 21,27 ---- self.log = log self.opener = FancyZURLopener() + self.Updating = False + self.ThrDownLoad = None + self.refreshed = 0.0 def AddLoader(self, loader): |
From: <sir...@us...> - 2003-03-29 10:45:27
|
Update of /cvsroot/btplusplus/BT++/src/TabTrans In directory sc8-pr-cvs1:/tmp/cvs-serv10828/src/TabTrans Modified Files: Grid.py Log Message: no message Index: Grid.py =================================================================== RCS file: /cvsroot/btplusplus/BT++/src/TabTrans/Grid.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Grid.py 28 Mar 2003 13:38:04 -0000 1.13 --- Grid.py 29 Mar 2003 10:45:17 -0000 1.14 *************** *** 255,259 **** break ! if x in [-2, -1, 0, 1, 2]: self.LabelResize['Over'] = true self.LabelResize['Num'] = col --- 255,259 ---- break ! if x == 0: self.LabelResize['Over'] = true self.LabelResize['Num'] = col |
From: <sir...@us...> - 2003-03-29 10:45:27
|
Update of /cvsroot/btplusplus/BT++/src/TabHistory In directory sc8-pr-cvs1:/tmp/cvs-serv10828/src/TabHistory Modified Files: Grid.py Log Message: no message Index: Grid.py =================================================================== RCS file: /cvsroot/btplusplus/BT++/src/TabHistory/Grid.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Grid.py 28 Mar 2003 12:44:27 -0000 1.2 --- Grid.py 29 Mar 2003 10:45:18 -0000 1.3 *************** *** 113,116 **** --- 113,119 ---- if col == 2: + if info('Status') == 'Downloading': + return 'Uploading' + if info('FractionDone') == -1.0 or \ info('Status') == 'Hashing': |
From: <bel...@us...> - 2003-03-29 01:10:08
|
Update of /cvsroot/btplusplus/BT++/src/core In directory sc8-pr-cvs1:/tmp/cvs-serv32575 Added Files: .cvsignore Log Message: Updated by TortoiseCVS --- NEW FILE: .cvsignore --- *.pyc |
From: <bel...@us...> - 2003-03-29 01:09:31
|
Update of /cvsroot/btplusplus/BT++/src/DlgAbout In directory sc8-pr-cvs1:/tmp/cvs-serv32298 Added Files: .cvsignore Log Message: Updated by TortoiseCVS --- NEW FILE: .cvsignore --- *.pyc |
From: <bel...@us...> - 2003-03-29 01:09:07
|
Update of /cvsroot/btplusplus/BT++/src/DlgAddTor In directory sc8-pr-cvs1:/tmp/cvs-serv32016 Added Files: .cvsignore Log Message: Updated by TortoiseCVS --- NEW FILE: .cvsignore --- *.pyc |
From: <bel...@us...> - 2003-03-29 01:08:10
|
Update of /cvsroot/btplusplus/BT++/src/DlgMain In directory sc8-pr-cvs1:/tmp/cvs-serv31605 Added Files: .cvsignore Log Message: Updated by TortoiseCVS --- NEW FILE: .cvsignore --- *.pyc |
From: <bel...@us...> - 2003-03-29 01:07:25
|
Update of /cvsroot/btplusplus/BT++/src/DlgPref In directory sc8-pr-cvs1:/tmp/cvs-serv31270 Added Files: .cvsignore Log Message: Updated by TortoiseCVS --- NEW FILE: .cvsignore --- *.pyc |
From: <bel...@us...> - 2003-03-29 01:06:09
|
Update of /cvsroot/btplusplus/BT++/src/TabHistory In directory sc8-pr-cvs1:/tmp/cvs-serv30672 Added Files: .cvsignore Log Message: Updated by TortoiseCVS --- NEW FILE: .cvsignore --- *.pyc |
From: <bel...@us...> - 2003-03-29 01:05:13
|
Update of /cvsroot/btplusplus/BT++/src/TabLog In directory sc8-pr-cvs1:/tmp/cvs-serv30259 Added Files: .cvsignore Log Message: Updated by TortoiseCVS --- NEW FILE: .cvsignore --- *.pyc |
From: <bel...@us...> - 2003-03-29 01:04:41
|
Update of /cvsroot/btplusplus/BT++/src/TabTrans In directory sc8-pr-cvs1:/tmp/cvs-serv30000 Added Files: .cvsignore Log Message: Updated by TortoiseCVS --- NEW FILE: .cvsignore --- *.pyc |
From: <bel...@us...> - 2003-03-29 00:54:20
|
Update of /cvsroot/btplusplus/BT++/src/WebTemplates In directory sc8-pr-cvs1:/tmp/cvs-serv24784/src/WebTemplates Modified Files: config.tmpl torrent.tmpl Log Message: Implementation of UpdateManager. Makes sure updates don't happen too fast if two automatic updaters collide (aka TimedUpdate and HTTP refreshs). Implemented FancyZURLOpener with zlib compression (used for InfoManager). Some fixes Index: config.tmpl =================================================================== RCS file: /cvsroot/btplusplus/BT++/src/WebTemplates/config.tmpl,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** config.tmpl 28 Mar 2003 21:09:35 -0000 1.4 --- config.tmpl 29 Mar 2003 00:54:14 -0000 1.5 *************** *** 129,133 **** <td><table border=1 width=100%> <tr> ! <td>Refresh torrent page every (seconds)</td> <td width=5%><input type=text style="width:100%" name=Display_Refresh value="<TMPL_VAR display_refresh>"></td> </tr> --- 129,134 ---- <td><table border=1 width=100%> <tr> ! <td>Refresh torrents every (seconds)<br> ! (Applies to the http auto-refresh of the page as well as adding new torrents in the respective dir)</td> <td width=5%><input type=text style="width:100%" name=Display_Refresh value="<TMPL_VAR display_refresh>"></td> </tr> Index: torrent.tmpl =================================================================== RCS file: /cvsroot/btplusplus/BT++/src/WebTemplates/torrent.tmpl,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** torrent.tmpl 28 Mar 2003 21:09:35 -0000 1.5 --- torrent.tmpl 29 Mar 2003 00:54:15 -0000 1.6 *************** *** 43,47 **** <tr> <TMPL_IF Seedless> ! <td style="font-color:red"> <TMPL_ELSE> <td> --- 43,47 ---- <tr> <TMPL_IF Seedless> ! <td style="color:red; font-weight:bold"> <TMPL_ELSE> <td> |
From: <bel...@us...> - 2003-03-29 00:54:19
|
Update of /cvsroot/btplusplus/BT++/src/core In directory sc8-pr-cvs1:/tmp/cvs-serv24784/src/core Modified Files: zurllib.py Log Message: Implementation of UpdateManager. Makes sure updates don't happen too fast if two automatic updaters collide (aka TimedUpdate and HTTP refreshs). Implemented FancyZURLOpener with zlib compression (used for InfoManager). Some fixes Index: zurllib.py =================================================================== RCS file: /cvsroot/btplusplus/BT++/src/core/zurllib.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** zurllib.py 28 Mar 2003 12:44:28 -0000 1.1 --- zurllib.py 29 Mar 2003 00:54:15 -0000 1.2 *************** *** 18,21 **** --- 18,80 ---- DEBUG=0 + # BEGIN - Added by Tobias Minich 3/28/2003 + class FancyZURLopener(FancyURLopener): + def open_http(self, url, data=None): + """Use HTTP protocol.""" + import httplib + user_passwd = None + if type(url) is types.StringType: + host, selector = splithost(url) + if host: + user_passwd, host = splituser(host) + host = unquote(host) + realhost = host + else: + host, selector = url + urltype, rest = splittype(selector) + url = rest + user_passwd = None + if urltype.lower() != 'http': + realhost = None + else: + realhost, rest = splithost(rest) + if realhost: + user_passwd, realhost = splituser(realhost) + if user_passwd: + selector = "%s://%s%s" % (urltype, realhost, rest) + if proxy_bypass(realhost): + host = realhost + + #print "proxy via http:", host, selector + if not host: raise IOError, ('http error', 'no host given') + if user_passwd: + import base64 + auth = base64.encodestring(user_passwd).strip() + else: + auth = None + h = httplib.HTTP(host) + if data is not None: + h.putrequest('POST', selector) + h.putheader('Content-type', 'application/x-www-form-urlencoded') + h.putheader('Content-length', '%d' % len(data)) + else: + h.putrequest('GET', selector) + if auth: h.putheader('Authorization', 'Basic %s' % auth) + if realhost: h.putheader('Host', realhost) + for args in self.addheaders: apply(h.putheader, args) + h.putheader("Accept-Encoding","gzip") + h.endheaders() + if data is not None: + h.send(data) + errcode, errmsg, headers = h.getreply() + fp = h.getfile() + if errcode == 200: + return addinfourldecompress(fp, headers, "http:" + url) + else: + if data is None: + return self.http_error(url, fp, errcode, errmsg, headers) + else: + return self.http_error(url, fp, errcode, errmsg, headers, data) + # END - Added by Tobias Minich 3/28/2003 class HTTPContentEncodingHandler(HTTPHandler): |
From: <bel...@us...> - 2003-03-29 00:54:19
|
Update of /cvsroot/btplusplus/BT++/src In directory sc8-pr-cvs1:/tmp/cvs-serv24784/src Modified Files: InfoManager.py LoaderManager.py TimedUpdate.py WT++.py WT++.pyw Log Message: Implementation of UpdateManager. Makes sure updates don't happen too fast if two automatic updaters collide (aka TimedUpdate and HTTP refreshs). Implemented FancyZURLOpener with zlib compression (used for InfoManager). Some fixes Index: InfoManager.py =================================================================== RCS file: /cvsroot/btplusplus/BT++/src/InfoManager.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** InfoManager.py 28 Mar 2003 21:09:34 -0000 1.1 --- InfoManager.py 29 Mar 2003 00:54:09 -0000 1.2 *************** *** 1,3 **** --- 1,4 ---- from threading import * + from core.zurllib import * from urllib import FancyURLopener from core.bencode import bdecode *************** *** 19,23 **** self.update = update self.log = log ! self.opener = FancyURLopener() def AddLoader(self, loader): --- 20,24 ---- self.update = update self.log = log ! self.opener = FancyZURLopener() def AddLoader(self, loader): *************** *** 27,31 **** self.log('['+self.server+'] added '+loader.Config['File'], loglevel = LOG_TRIVIAL) self.loaders.append(loader) ! self.ForcedUpdate() def RemoveLoader(self, loader): --- 28,32 ---- self.log('['+self.server+'] added '+loader.Config['File'], loglevel = LOG_TRIVIAL) self.loaders.append(loader) ! self.Update( force = True ) def RemoveLoader(self, loader): *************** *** 38,43 **** except: pass data = h.read() ! try: self.log('['+self.server+'] Info Download finished', loglevel = LOG_TRIVIAL) ! except: pass h.close() failed = False --- 39,48 ---- except: pass data = h.read() ! if h.iscompressed(): ! try: self.log('['+self.server+'] Info Download finished (compressed)', loglevel = LOG_TRIVIAL) ! except: pass ! else: ! try: self.log('['+self.server+'] Info Download finished', loglevel = LOG_TRIVIAL) ! except: pass h.close() failed = False *************** *** 64,77 **** self.Updating = False ! def Update(self): ! if time() > (self.refreshed + (60 * self.update)): ! self.ForcedUpdate() ! ! def ForcedUpdate(self): ! if not self.Updating: ! self.ThrDownLoad = Thread( target = self.DownLoader ) ! self.ThrDownLoad.setDaemon(True) ! self.ThrDownLoad.start() ! class InfoManager: servers = [] --- 69,79 ---- self.Updating = False ! def Update(self, force = False): ! if (time() > (self.refreshed + (60 * self.update))) or force: ! if not self.Updating: ! self.ThrDownLoad = Thread( target = self.DownLoader ) ! self.ThrDownLoad.setDaemon(True) ! self.ThrDownLoad.start() ! class InfoManager: servers = [] Index: LoaderManager.py =================================================================== RCS file: /cvsroot/btplusplus/BT++/src/LoaderManager.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** LoaderManager.py 28 Mar 2003 21:09:34 -0000 1.10 --- LoaderManager.py 29 Mar 2003 00:54:13 -0000 1.11 *************** *** 274,278 **** for loader in self.Loaders: if loader.IsRunning(): ! loader.PauseDownload() def Destroy(self): --- 274,278 ---- for loader in self.Loaders: if loader.IsRunning(): ! loader.PauseDownload(user = true) def Destroy(self): Index: TimedUpdate.py =================================================================== RCS file: /cvsroot/btplusplus/BT++/src/TimedUpdate.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TimedUpdate.py 19 Feb 2003 20:45:52 -0000 1.1 --- TimedUpdate.py 29 Mar 2003 00:54:13 -0000 1.2 *************** *** 1,3 **** ! from threading import Thread, Event class TimedUpdate(Thread): --- 1,4 ---- ! from threading import Thread, Event ! from time import time class TimedUpdate(Thread): *************** *** 25,26 **** --- 26,52 ---- apply( self._Func, self._Param ) self._Done.wait(self._Interval) + + class UpdateManager: + def __init__(self, interval, func, param = []): + self._Interval = interval + self._Func = func + self._Param = param + self._Refreshed = time() + + self._Thread = TimedUpdate(interval, self.Update) + self.Update( force = True ) + self._Thread.setDaemon(1) + self._Thread.Start() + + def Update(self, force = False): + if (time() > (self._Refreshed + self._Interval)) or force: + apply( self._Func, self._Param ) + self._Refreshed = time() + + def SetInterval(self, interval): + self._Interval = interval + self._Thread.SetInterval(interval) + + def ShutDown(self): + self._Thread.Shutdown() + Index: WT++.py =================================================================== RCS file: /cvsroot/btplusplus/BT++/src/WT++.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** WT++.py 28 Mar 2003 21:09:34 -0000 1.5 --- WT++.py 29 Mar 2003 00:54:14 -0000 1.6 *************** *** 5,9 **** from shutil import copyfile from ConfigFile import Config ! from WebServer.BTWebServer import BTWebServer, BTWait, WTLoaders, WTSeeds from threading import * from readline import * --- 5,9 ---- from shutil import copyfile from ConfigFile import Config ! from WebServer.BTWebServer import BTWebServer, BTWait, WTLoaders, WTSeeds, WTTimer from threading import * from readline import * *************** *** 46,48 **** --- 46,49 ---- WTLoaders.ShutDown() WTSeeds.ShutDown() + WTTimer.ShutDown() Index: WT++.pyw =================================================================== RCS file: /cvsroot/btplusplus/BT++/src/WT++.pyw,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** WT++.pyw 28 Mar 2003 21:09:34 -0000 1.2 --- WT++.pyw 29 Mar 2003 00:54:14 -0000 1.3 *************** *** 5,9 **** from shutil import copyfile from ConfigFile import Config ! from WebServer.BTWebServer import BTWebServer, BTWait, WTLoaders, WTSeeds from threading import * --- 5,9 ---- from shutil import copyfile from ConfigFile import Config ! from WebServer.BTWebServer import BTWebServer, BTWait, WTLoaders, WTSeeds, WTTimer from threading import * *************** *** 34,36 **** --- 34,37 ---- WTLoaders.ShutDown() WTSeeds.ShutDown() + WTTimer.ShutDown() |
From: <bel...@us...> - 2003-03-29 00:54:18
|
Update of /cvsroot/btplusplus/BT++/src/WebServer In directory sc8-pr-cvs1:/tmp/cvs-serv24784/src/WebServer Modified Files: BTWebServer.py Log Message: Implementation of UpdateManager. Makes sure updates don't happen too fast if two automatic updaters collide (aka TimedUpdate and HTTP refreshs). Implemented FancyZURLOpener with zlib compression (used for InfoManager). Some fixes Index: BTWebServer.py =================================================================== RCS file: /cvsroot/btplusplus/BT++/src/WebServer/BTWebServer.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** BTWebServer.py 28 Mar 2003 21:09:34 -0000 1.12 --- BTWebServer.py 29 Mar 2003 00:54:14 -0000 1.13 *************** *** 14,17 **** --- 14,18 ---- from InfoManager import InfoManager from core.CurrentRateMeasure import GlobalMeasure + from TimedUpdate import UpdateManager import socket *************** *** 43,53 **** except: pass ! templateRoot = TemplateManager().prepare("WebTemplates/root.tmpl") ! templateMenu = TemplateManager().prepare("WebTemplates/menu.tmpl") ! templateExit = TemplateManager().prepare("WebTemplates/exit.tmpl") ! templateDLFail = TemplateManager().prepare("WebTemplates/dl_fail.tmpl") ! templateTorrent = TemplateManager().prepare("WebTemplates/torrent.tmpl") ! templateLog = TemplateManager().prepare("WebTemplates/log.tmpl") ! templateConfig = TemplateManager().prepare("WebTemplates/config.tmpl") ########################################################################################################### --- 44,56 ---- except: pass ! WTTemplateManager = TemplateManager() ! ! templateRoot = WTTemplateManager.prepare("WebTemplates/root.tmpl") ! templateMenu = WTTemplateManager.prepare("WebTemplates/menu.tmpl") ! templateExit = WTTemplateManager.prepare("WebTemplates/exit.tmpl") ! templateDLFail = WTTemplateManager.prepare("WebTemplates/dl_fail.tmpl") ! templateTorrent = WTTemplateManager.prepare("WebTemplates/torrent.tmpl") ! templateLog = WTTemplateManager.prepare("WebTemplates/log.tmpl") ! templateConfig = WTTemplateManager.prepare("WebTemplates/config.tmpl") ########################################################################################################### *************** *** 105,108 **** --- 108,113 ---- del WebLog[0] + WTInfo = InfoManager(log = WebLogit, update = int(HTTPConfig.Get('Display', 'RefreshInfo'))) + WTSeeds = SeedManager( [ Config.Get('Paths', 'History'), Config.Get('Paths', 'Incoming'), *************** *** 137,144 **** --- 142,153 ---- except: loader.OnError('Could not move downloaded file.') + + WTInfo.RemoveLoader(loader) new = WTSeeds.CreateNewLoader(loader.Config['Tor']) if new == None: return + + WTInfo.Update() if Config.Get('Download', 'KeepUpload'): *************** *** 169,177 **** WTSeeds.Update() - WTInfo = InfoManager(log = WebLogit, update = int(HTTPConfig.Get('Display', 'RefreshInfo'))) WTInfo.AddManager(WTLoaders) WTInfo.AddManager(WTSeeds) WTInfo.Update() ########################################################################################################### ########################################################################################################### --- 178,192 ---- WTSeeds.Update() WTInfo.AddManager(WTLoaders) WTInfo.AddManager(WTSeeds) WTInfo.Update() + def UpdateManagers(): + WTLoaders.Update() + WTSeeds.Update() + WTInfo.Update() + + WTTimer = UpdateManager(int(HTTPConfig.Get('Display', 'Refresh')), UpdateManagers) + ########################################################################################################### ########################################################################################################### *************** *** 182,193 **** server_version = "WTHTTP/" + __version__ ! def Update(self): ! WTLoaders.Update() ! WTSeeds.Update() ! WTInfo.Update() def UpdateConfig(self): WTInfo.UpdateUpdate(int(HTTPConfig.Get('Display', 'RefreshInfo'))) def do_GET(self): --- 197,207 ---- server_version = "WTHTTP/" + __version__ ! def Update(self): ! WTTimer.Update(force = True) def UpdateConfig(self): WTInfo.UpdateUpdate(int(HTTPConfig.Get('Display', 'RefreshInfo'))) + WTTimer.SetInterval(int(HTTPConfig.Get('Display', 'Refresh'))) def do_GET(self): *************** *** 227,233 **** if result['command']=='Pause': if result['seed']=='0': ! WTLoaders.Loaders[int(result['nr'])-1].PauseDownload() else: ! WTSeeds.Loaders[int(result['nr'])-1].PauseDownload() elif result['command']=='Resume': if result['seed']=='0': --- 241,247 ---- if result['command']=='Pause': if result['seed']=='0': ! WTLoaders.Loaders[int(result['nr'])-1].PauseDownload(user = true) else: ! WTSeeds.Loaders[int(result['nr'])-1].PauseDownload(user = true) elif result['command']=='Resume': if result['seed']=='0': *************** *** 312,320 **** dummy, self.requested = temp.split('/') self.requested = self.requested.replace('?',''); ! if self.requested in ['','exit','menu','torrents','config','log']: self.send_response(200) self.send_header("Content-type", "text/html") self.send_header("Expires", "Mon, 26 Jul 1997 05:00:00 GMT") self.end_headers() else: self.send_error(404, "File not found") --- 326,338 ---- dummy, self.requested = temp.split('/') self.requested = self.requested.replace('?',''); ! if self.requested in ['','exit','menu','torrents','config','log','refreshtemplates','forceupdate']: self.send_response(200) self.send_header("Content-type", "text/html") self.send_header("Expires", "Mon, 26 Jul 1997 05:00:00 GMT") self.end_headers() + if self.requested == 'forceupdate': + for server in WTInfo.servers: + server.Update(force = True) + self.requested = '' else: self.send_error(404, "File not found") *************** *** 444,446 **** --- 462,466 ---- def server(self): self.serve_forever() + + |
From: <bel...@us...> - 2003-03-29 00:46:02
|
Update of /cvsroot/btplusplus/BT++/src/WebServer In directory sc8-pr-cvs1:/tmp/cvs-serv21393 Added Files: .cvsignore Log Message: Updated by TortoiseCVS --- NEW FILE: .cvsignore --- *.pyc |
From: <bel...@us...> - 2003-03-29 00:45:42
|
Update of /cvsroot/btplusplus/BT++/src/WebTemplates In directory sc8-pr-cvs1:/tmp/cvs-serv21237 Added Files: .cvsignore Log Message: Updated by TortoiseCVS --- NEW FILE: .cvsignore --- *.tmplc |
From: <bel...@us...> - 2003-03-28 21:09:40
|
Update of /cvsroot/btplusplus/BT++/src In directory sc8-pr-cvs1:/tmp/cvs-serv17312/src Modified Files: Loader.py LoaderManager.py WT++.py WT++.pyw Added Files: InfoManager.py Log Message: Implemented InfoManager for tracker info (namely seeds/downloaders). It manages updates so only one request is sent per tracker if multiple torrents use the same one. Some minor fixes. --- NEW FILE: InfoManager.py --- from threading import * from urllib import FancyURLopener from core.bencode import bdecode from BTConstants import * from time import * class InfoServer: loaders = [] server = '' Updating = False ThrDownLoad = None log = None refreshed = 0.0 update = 5 def __init__(self, server, log = None, update = 5): self.loaders = [] self.server = server self.update = update self.log = log self.opener = FancyURLopener() def AddLoader(self, loader): for aloader in self.loaders: if aloader.Config['InfoHash']==loader.Config['InfoHash']: return False self.log('['+self.server+'] added '+loader.Config['File'], loglevel = LOG_TRIVIAL) self.loaders.append(loader) self.ForcedUpdate() def RemoveLoader(self, loader): self.loaders.remove(loader) def DownLoader(self): self.Updating = True h = self.opener.open(self.server) try: self.log('['+self.server+'] Info Download started', loglevel = LOG_TRIVIAL) except: pass data = h.read() try: self.log('['+self.server+'] Info Download finished', loglevel = LOG_TRIVIAL) except: pass h.close() failed = False try: data = bdecode(data) except: try: self.log('['+self.server+'] Info Download failed', loglevel = LOG_TRIVIAL) except: pass failed = True files = {} try: files = data['files'] except: pass for loader in self.loaders: if files.has_key(loader.Config['InfoHash']): info = files[loader.Config['InfoHash']] loader.UpdateExtendedInfo(info['complete'], info['incomplete']) else: loader.UpdateExtendedInfo('error') if failed: self.refreshed = time() - (60 * self.update) else: self.refreshed = time() self.Updating = False def Update(self): if time() > (self.refreshed + (60 * self.update)): self.ForcedUpdate() def ForcedUpdate(self): if not self.Updating: self.ThrDownLoad = Thread( target = self.DownLoader ) self.ThrDownLoad.setDaemon(True) self.ThrDownLoad.start() class InfoManager: servers = [] managers = [] log = None update = 5 def __init__(self, update = 5, log = None): self.log = log self.update = update def Update(self): for manager in self.managers: for loader in manager.Loaders: self.AddLoader(loader) for server in self.servers: server.Update() def UpdateUpdate(self, update): self.update = update for server in self.servers: server.update = update def AddLoader(self, loader): for server in self.servers: if server.server == loader.Config['Scrape']: server.AddLoader(loader) return True server = InfoServer(loader.Config['Scrape'], log = self.log, update = self.update) self.servers.append(server) server.AddLoader(loader) def RemoveLoader(self, loader): for server in self.servers: if server.server == loader.Config['Scrape']: server.RemoveLoader(loader) return True def AddManager(self, manager): self.managers.append(manager) Index: Loader.py =================================================================== RCS file: /cvsroot/btplusplus/BT++/src/Loader.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Loader.py 28 Mar 2003 14:58:27 -0000 1.7 --- Loader.py 28 Mar 2003 21:09:34 -0000 1.8 *************** *** 8,11 **** --- 8,12 ---- from sha import sha from socket import error as socketerror + from string import split, join from core.Choker import Choker *************** *** 90,93 **** --- 91,100 ---- self.Config['Tracker'] = torrent['announce'] + t = split(torrent['announce'],'/') + if t[-1]=='': + t[-2] = 'scrape' + else: + t[-1] = 'scrape' + self.Config['Scrape'] = join(t, '/'); self.Config['File'] = torinfo['name'] self.Config['Filename'] = path.join(self.Config['DirTemp'], torinfo['name']) *************** *** 134,137 **** --- 141,146 ---- self.Info['Size'] = self.Config['Size'] self.Info['File'] = self.Config['File'] + + self.UpdateExtendedInfo() return true *************** *** 270,273 **** --- 279,289 ---- else: return '%d min %02d sec' % (m, s) + + ########################################################################################################### + ########################################################################################################### + + def UpdateExtendedInfo( self, complete = '?', incomplete = '?' ): + self.Info['complete'] = complete + self.Info['incomplete'] = incomplete ########################################################################################################### Index: LoaderManager.py =================================================================== RCS file: /cvsroot/btplusplus/BT++/src/LoaderManager.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** LoaderManager.py 28 Mar 2003 13:38:04 -0000 1.9 --- LoaderManager.py 28 Mar 2003 21:09:34 -0000 1.10 *************** *** 3,6 **** --- 3,7 ---- from Loader import Loader from BTConstants import * + from core.CurrentRateMeasure import GlobalMeasure class LoaderManager: *************** *** 53,57 **** if self.Log != None: self.Log( 'Error adding torrent "' + torrent + '"...', loglevel = LOG_ERROR ) ! return None --- 54,58 ---- if self.Log != None: self.Log( 'Error adding torrent "' + torrent + '"...', loglevel = LOG_ERROR ) ! return None Index: WT++.py =================================================================== RCS file: /cvsroot/btplusplus/BT++/src/WT++.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** WT++.py 11 Mar 2003 01:07:10 -0000 1.4 --- WT++.py 28 Mar 2003 21:09:34 -0000 1.5 *************** *** 33,41 **** pass - print ("Started") httpd = BTWebServer() httpdth = Thread(target = httpd.server) httpdth.setDaemon(1) httpdth.start() inthr = Thread(target = evalinput) --- 33,41 ---- pass httpd = BTWebServer() httpdth = Thread(target = httpd.server) httpdth.setDaemon(1) httpdth.start() + print ("Started") inthr = Thread(target = evalinput) Index: WT++.pyw =================================================================== RCS file: /cvsroot/btplusplus/BT++/src/WT++.pyw,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** WT++.pyw 25 Mar 2003 00:27:02 -0000 1.1 --- WT++.pyw 28 Mar 2003 21:09:34 -0000 1.2 *************** *** 25,33 **** pass - print ("Started") httpd = BTWebServer() httpdth = Thread(target = httpd.server) httpdth.setDaemon(1) httpdth.start() BTWait.wait() --- 25,33 ---- pass httpd = BTWebServer() httpdth = Thread(target = httpd.server) httpdth.setDaemon(1) httpdth.start() + print ("Started") BTWait.wait() |