From a4c5b0615225ebaaf9ccc0536c63c1db280acafb Mon Sep 17 00:00:00 2001 From: Julio Biason Date: Fri, 25 Dec 2009 20:38:20 -0200 Subject: [PATCH] Changed .name for .getName()/.setName() to be compatible with Pytho 2.5 --- ...9419930d0857751427cd66cbb7f18dbf6a341c7.yaml | 8 ++++++-- mitterlib/ui/ui_pygtk.py | 17 +++++++++-------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/issues/issue-29419930d0857751427cd66cbb7f18dbf6a341c7.yaml b/issues/issue-29419930d0857751427cd66cbb7f18dbf6a341c7.yaml index 1f75079..b8cc54f 100644 --- a/issues/issue-29419930d0857751427cd66cbb7f18dbf6a341c7.yaml +++ b/issues/issue-29419930d0857751427cd66cbb7f18dbf6a341c7.yaml @@ -5,8 +5,8 @@ type: :bugfix component: pygtk release: 1.0.0 reporter: Julio Biason -status: :unstarted -disposition: +status: :closed +disposition: :fixed creation_time: 2009-12-22 20:01:36.001876 Z references: [] @@ -16,3 +16,7 @@ log_events: - Julio Biason - created - It's "setName()", it seems. +- - 2009-12-25 22:37:50.686391 Z + - Julio Biason + - closed with disposition fixed + - "" diff --git a/mitterlib/ui/ui_pygtk.py b/mitterlib/ui/ui_pygtk.py index 63c956b..3bf4dcf 100644 --- a/mitterlib/ui/ui_pygtk.py +++ b/mitterlib/ui/ui_pygtk.py @@ -108,7 +108,8 @@ class _WorkerThread(threading.Thread, _IdleObject): def run(self): # call the function - _log.debug('Thread d %s calling %s', self.name, str(self._function)) + _log.debug('Thread d %s calling %s', self.getName(), + str(self._function)) args = self._args kwargs = self._kwargs @@ -121,7 +122,7 @@ class _WorkerThread(threading.Thread, _IdleObject): self.emit("exception", exc) return - _log.debug('Thread id %s completed', self.name) + _log.debug('Thread id %s completed', self.getName()) self.emit("completed", result) return @@ -146,18 +147,18 @@ class _ThreadManager(object): # not actually a widget. It's the object that emitted the signal, in # this case, the _WorkerThread object. - thread_id = widget.name + thread_id = widget.getName() - _log.debug('Thread id %s completed, %d threads in the queue', thread_id, - len(self._thread_pool)) + _log.debug('Thread id %s completed, %d threads in the queue', + thread_id, len(self._thread_pool)) self._running.remove(thread_id) if self._thread_pool: if len(self._running) < self._max_threads: next = self._thread_pool.pop() - _log.debug('Dequeuing thread %s', next.name) - self._running.append(next.name) + _log.debug('Dequeuing thread %s', next.getName()) + self._running.append(next.getName()) next.start() return @@ -171,7 +172,7 @@ class _ThreadManager(object): are parameters passed to the function.""" thread = _WorkerThread(func, *args, **kwargs) - thread_id = '%s' % (self._thread_id) + thread_id = '%s-%s' % (self._thread_id, func.__name__) thread.connect('completed', complete_cb) thread.connect('completed', self._remove_thread)