Changeset 2033
- Timestamp:
- 10/23/07 02:43:21 (15 months ago)
- Files:
-
- 4 modified
-
tags/deluge-0.5.5.95/src/core.py (modified) (4 diffs)
-
tags/deluge-0.5.5.95/src/interface.py (modified) (3 diffs)
-
trunk/src/core.py (modified) (4 diffs)
-
trunk/src/interface.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tags/deluge-0.5.5.95/src/core.py
r2013 r2033 163 163 self.user_paused = False 164 164 self.uploaded_memory = 0 165 self.initial_uploaded_memory = 0 165 166 self.upload_rate_limit = 0 166 167 self.download_rate_limit = 0 … … 279 280 280 281 def quit(self): 281 # Analyze data needed for pickling, etc.282 self.pre_quitting()283 284 282 # Pickle the prefs 285 283 print "Saving prefs..." … … 314 312 output.close() 315 313 316 def pre_quitting(self):314 def save_upmem(self): 317 315 # Save the uploaded data from this session to the existing upload memory 318 316 for unique_ID in self.unique_IDs.keys(): 319 317 # self.get_core_torrent_state purposefully not cached. 320 self.unique_IDs[unique_ID].uploaded_memory += \ 318 self.unique_IDs[unique_ID].uploaded_memory = \ 319 self.unique_IDs[unique_ID].initial_uploaded_memory + \ 321 320 self.get_core_torrent_state(unique_ID, False)['total_upload'] 322 321 … … 983 982 984 983 def calc_ratio(self, unique_ID, torrent_state): 985 up = float( (torrent_state['total_payload_upload'] / 1024) + (self.unique_IDs[unique_ID].uploaded_memory / 1024))984 up = float(self.unique_IDs[unique_ID].uploaded_memory / 1024) 986 985 down = float(torrent_state["total_done"] / 1024) 987 986 try: -
tags/deluge-0.5.5.95/src/interface.py
r2029 r2033 162 162 self.dht_timer = 0 163 163 self.dht_skip = False 164 self.memory_timer = 0 164 165 165 166 def connect_signals(self): … … 963 964 self.manager.replace_trackers(unique_id, \ 964 965 self.manager.unique_IDs[unique_id].trackers) 966 if self.manager.unique_IDs[unique_id].uploaded_memory: 967 self.manager.unique_IDs[unique_id].initial_uploaded_memory \ 968 = self.manager.unique_IDs[unique_id].uploaded_memory 965 969 except AttributeError: 966 970 pass … … 982 986 self.update_interface = self.window.get_property("visible") and not \ 983 987 self.is_minimized 984 988 self.memory_timer += 1 989 if (self.memory_timer == 60): 990 self.manager.save_upmem() 991 self.memory_timer = 0 985 992 # Handle the events 986 993 self.manager.handle_events() -
trunk/src/core.py
r2013 r2033 163 163 self.user_paused = False 164 164 self.uploaded_memory = 0 165 self.initial_uploaded_memory = 0 165 166 self.upload_rate_limit = 0 166 167 self.download_rate_limit = 0 … … 279 280 280 281 def quit(self): 281 # Analyze data needed for pickling, etc.282 self.pre_quitting()283 284 282 # Pickle the prefs 285 283 print "Saving prefs..." … … 314 312 output.close() 315 313 316 def pre_quitting(self):314 def save_upmem(self): 317 315 # Save the uploaded data from this session to the existing upload memory 318 316 for unique_ID in self.unique_IDs.keys(): 319 317 # self.get_core_torrent_state purposefully not cached. 320 self.unique_IDs[unique_ID].uploaded_memory += \ 318 self.unique_IDs[unique_ID].uploaded_memory = \ 319 self.unique_IDs[unique_ID].initial_uploaded_memory + \ 321 320 self.get_core_torrent_state(unique_ID, False)['total_upload'] 322 321 … … 983 982 984 983 def calc_ratio(self, unique_ID, torrent_state): 985 up = float( (torrent_state['total_payload_upload'] / 1024) + (self.unique_IDs[unique_ID].uploaded_memory / 1024))984 up = float(self.unique_IDs[unique_ID].uploaded_memory / 1024) 986 985 down = float(torrent_state["total_done"] / 1024) 987 986 try: -
trunk/src/interface.py
r2029 r2033 162 162 self.dht_timer = 0 163 163 self.dht_skip = False 164 self.memory_timer = 0 164 165 165 166 def connect_signals(self): … … 963 964 self.manager.replace_trackers(unique_id, \ 964 965 self.manager.unique_IDs[unique_id].trackers) 966 if self.manager.unique_IDs[unique_id].uploaded_memory: 967 self.manager.unique_IDs[unique_id].initial_uploaded_memory \ 968 = self.manager.unique_IDs[unique_id].uploaded_memory 965 969 except AttributeError: 966 970 pass … … 982 986 self.update_interface = self.window.get_property("visible") and not \ 983 987 self.is_minimized 984 988 self.memory_timer += 1 989 if (self.memory_timer == 60): 990 self.manager.save_upmem() 991 self.memory_timer = 0 985 992 # Handle the events 986 993 self.manager.handle_events()
