From a111d8e6483996ea031d589f51bc1c55c7bb8461 Mon Sep 17 00:00:00 2001 From: Marcos Pinto Date: Wed, 8 Aug 2007 21:58:43 +0000 Subject: [PATCH] revert tray tooltip lifetime --- src/interface.py | 36 ++---------------------------------- 1 file changed, 2 insertions(+), 34 deletions(-) diff --git a/src/interface.py b/src/interface.py index 2fd9d3a5c..9f1bad118 100644 --- a/src/interface.py +++ b/src/interface.py @@ -52,9 +52,6 @@ class DelugeGTK: #Start the Deluge Manager: self.manager = core.Manager(common.CLIENT_CODE, common.CLIENT_VERSION, '%s %s'%(common.PROGRAM_NAME, common.PROGRAM_VERSION), common.CONFIG_DIR) - self.logdir = os.path.join(common.CONFIG_DIR, 'logs') - self.alltime_download = None - self.alltime_upload = None self.plugins = plugins.PluginManager(self.manager, self) self.plugins.add_plugin_dir(common.PLUGIN_DIR) if os.path.isdir(os.path.join(common.CONFIG_DIR , 'plugins')): @@ -819,20 +816,6 @@ class DelugeGTK: ## Start the timer that updates the interface def start(self, start_in_tray=False, cmd_line_torrents=None): - if not os.path.isdir(self.logdir): - os.mkdir(self.logdir) - log = os.path.join(self.logdir, "stats.log") - try: - logfile = open(log, "r") - except: - self.alltime_download = 0 - self.alltime_upload = 0 - else: - readlines = logfile.readlines() - self.alltime_download = long(readlines[0]) - self.alltime_upload = long(readlines[1]) - logfile.close() - if cmd_line_torrents is None: cmd_line_torrents = [] @@ -981,13 +964,8 @@ class DelugeGTK: else: max_connections = int(self.config.get("max_connections_global")) - dlall = long(core_state['total_downloaded']) + self.alltime_download - ulall = long(core_state['total_uploaded']) + self.alltime_upload - - dlspeed = common.fspeed(core_state['download_rate']) - ulspeed = common.fspeed(core_state['upload_rate']) - dltotal = common.fsize(dlall) - ultotal = common.fsize(ulall) + dltotal = common.fsize(core_state['total_downloaded']) + ultotal = common.fsize(core_state['total_uploaded']) if self.config.get("max_download_speed") < 0: dlspeed_max = _("Unlimited") @@ -1362,16 +1340,6 @@ class DelugeGTK: self.shutdown() def shutdown(self): - core_state = self.manager.get_state() - - dlall = long(core_state['total_downloaded']) + self.alltime_download - ulall = long(core_state['total_uploaded']) + self.alltime_upload - - log = os.path.join(self.logdir, "stats.log") - logfile = open(log, "w") - logfile.writelines([str(dlall)+'\n', str(ulall)+'\n']) - logfile.close() - enabled_plugins = ':'.join(self.plugins.get_enabled_plugins()) self.config.set('enabled_plugins', enabled_plugins) self.save_window_settings()