From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.77) (envelope-from ) id 1SqnyZ-00012N-2e for garchives@archives.gentoo.org; Mon, 16 Jul 2012 16:16:47 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 09901E0777; Mon, 16 Jul 2012 16:15:49 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id D1EA2E0777 for ; Mon, 16 Jul 2012 16:15:49 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 307DC1B404E for ; Mon, 16 Jul 2012 16:15:49 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 19E16E5449 for ; Mon, 16 Jul 2012 16:15:46 +0000 (UTC) From: "André Erdmann" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "André Erdmann" Message-ID: <1342175813.5e67a62f326f96b813e8fdd19a50d236874a41bd.dywi@gentoo> Subject: [gentoo-commits] proj/R_overlay:master commit in: roverlay/ X-VCS-Repository: proj/R_overlay X-VCS-Files: roverlay/errorqueue.py X-VCS-Directories: roverlay/ X-VCS-Committer: dywi X-VCS-Committer-Name: André Erdmann X-VCS-Revision: 5e67a62f326f96b813e8fdd19a50d236874a41bd X-VCS-Branch: master Date: Mon, 16 Jul 2012 16:15:46 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 93dba810-83e5-4790-9684-9c704fa1b237 X-Archives-Hash: cb914091d8ec2744aae8fa45d037638e commit: 5e67a62f326f96b813e8fdd19a50d236874a41bd Author: Andr=C3=A9 Erdmann mailerd de> AuthorDate: Fri Jul 13 10:36:53 2012 +0000 Commit: Andr=C3=A9 Erdmann mailerd de> CommitDate: Fri Jul 13 10:36:53 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/R_overlay.git= ;a=3Dcommit;h=3D5e67a62f remove NopErrorQueue --- roverlay/errorqueue.py | 29 ++++------------------------- 1 files changed, 4 insertions(+), 25 deletions(-) diff --git a/roverlay/errorqueue.py b/roverlay/errorqueue.py index d0aa042..2b5135a 100644 --- a/roverlay/errorqueue.py +++ b/roverlay/errorqueue.py @@ -1,33 +1,11 @@ -import sys import threading =20 -class _EQueue ( object ) : pass - -class NopErrorQueue ( _EQueue ): - """This can be used as error queue in single-threaded execution.""" - def __init__ ( self ): - self.empty =3D True - - def push ( self, context, error ): - self.empty =3D False - sys.stderr.write ( "Exception from {!r}:\n".format ( context ) ) - raise error - - def really_empty ( self ): return self.empty - def attach_queue ( self, q, unblock_item ): pass - def remove_queue ( self, q ): pass - def unblock_queues ( self ): pass - def peek ( self ): return ( None, None ) - def get_all ( self ): return ( ( None, None ), ) - def get_exceptions ( self ): return () - - -#class ErrorQueue ( NopErrorQueue ): -class ErrorQueue ( _EQueue ): +class ErrorQueue ( object ): """This is the error queue for threaded execution.""" # (it's not a queue) =20 - def __init__ ( self ): + def __init__ ( self, using_threads=3DTrue ): + self.using_threads =3D using_threads self.empty =3D True self._exceptions =3D list() # this error queue is able to unblock waiting queues (in future; TODO) @@ -65,6 +43,7 @@ class ErrorQueue ( _EQueue ): self.empty =3D False self._unblock_queues() =20 + if not self.using_threads: raise error def unblock_queues ( self ): """Unblocks all attached queues.""" with self._lock: From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.77) (envelope-from ) id 1SpdM9-00062z-UN for garchives@archives.gentoo.org; Fri, 13 Jul 2012 10:44:18 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 324B5E0230; Fri, 13 Jul 2012 10:44:05 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id F0064E0230 for ; Fri, 13 Jul 2012 10:44:04 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 2027C1B40C6 for ; Fri, 13 Jul 2012 10:44:04 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id D4EEFE5433 for ; Fri, 13 Jul 2012 10:44:02 +0000 (UTC) From: "André Erdmann" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "André Erdmann" Message-ID: <1342175813.5e67a62f326f96b813e8fdd19a50d236874a41bd.dywi@gentoo> Subject: [gentoo-commits] proj/R_overlay:depres_wip commit in: roverlay/ X-VCS-Repository: proj/R_overlay X-VCS-Files: roverlay/errorqueue.py X-VCS-Directories: roverlay/ X-VCS-Committer: dywi X-VCS-Committer-Name: André Erdmann X-VCS-Revision: 5e67a62f326f96b813e8fdd19a50d236874a41bd X-VCS-Branch: depres_wip Date: Fri, 13 Jul 2012 10:44:02 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 31e7f8cf-bd26-47da-8a4b-8e7fc443b8fe X-Archives-Hash: 7d4952ccb24a18d9b10aa5e6f9806aeb Message-ID: <20120713104402.TEfmsjfmnpJCzCsTj1ImKCPmLqCuHJpiyFCJ9Bi1--k@z> commit: 5e67a62f326f96b813e8fdd19a50d236874a41bd Author: Andr=C3=A9 Erdmann mailerd de> AuthorDate: Fri Jul 13 10:36:53 2012 +0000 Commit: Andr=C3=A9 Erdmann mailerd de> CommitDate: Fri Jul 13 10:36:53 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/R_overlay.git= ;a=3Dcommit;h=3D5e67a62f remove NopErrorQueue --- roverlay/errorqueue.py | 29 ++++------------------------- 1 files changed, 4 insertions(+), 25 deletions(-) diff --git a/roverlay/errorqueue.py b/roverlay/errorqueue.py index d0aa042..2b5135a 100644 --- a/roverlay/errorqueue.py +++ b/roverlay/errorqueue.py @@ -1,33 +1,11 @@ -import sys import threading =20 -class _EQueue ( object ) : pass - -class NopErrorQueue ( _EQueue ): - """This can be used as error queue in single-threaded execution.""" - def __init__ ( self ): - self.empty =3D True - - def push ( self, context, error ): - self.empty =3D False - sys.stderr.write ( "Exception from {!r}:\n".format ( context ) ) - raise error - - def really_empty ( self ): return self.empty - def attach_queue ( self, q, unblock_item ): pass - def remove_queue ( self, q ): pass - def unblock_queues ( self ): pass - def peek ( self ): return ( None, None ) - def get_all ( self ): return ( ( None, None ), ) - def get_exceptions ( self ): return () - - -#class ErrorQueue ( NopErrorQueue ): -class ErrorQueue ( _EQueue ): +class ErrorQueue ( object ): """This is the error queue for threaded execution.""" # (it's not a queue) =20 - def __init__ ( self ): + def __init__ ( self, using_threads=3DTrue ): + self.using_threads =3D using_threads self.empty =3D True self._exceptions =3D list() # this error queue is able to unblock waiting queues (in future; TODO) @@ -65,6 +43,7 @@ class ErrorQueue ( _EQueue ): self.empty =3D False self._unblock_queues() =20 + if not self.using_threads: raise error def unblock_queues ( self ): """Unblocks all attached queues.""" with self._lock: