SF.net SVN: fclient: [381] trunk/sandbox/fcp2/test_fcp/dummy_io.py
Status: Pre-Alpha
Brought to you by:
jurner
From: <jU...@us...> - 2008-04-09 07:32:06
|
Revision: 381 http://fclient.svn.sourceforge.net/fclient/?rev=381&view=rev Author: jUrner Date: 2008-04-09 00:32:04 -0700 (Wed, 09 Apr 2008) Log Message: ----------- moved errors and loggers to consts for easier access Modified Paths: -------------- trunk/sandbox/fcp2/test_fcp/dummy_io.py Modified: trunk/sandbox/fcp2/test_fcp/dummy_io.py =================================================================== --- trunk/sandbox/fcp2/test_fcp/dummy_io.py 2008-04-09 07:31:51 UTC (rev 380) +++ trunk/sandbox/fcp2/test_fcp/dummy_io.py 2008-04-09 07:32:04 UTC (rev 381) @@ -33,30 +33,30 @@ def connect(self, **kwargs): if not self._allowConnect: - raise iohandler.IOHandler.IOConnectFailed('Refused') + raise consts.IOConnectFailedError('Refused') self._isOpen = True def read(self, n): if self._isBroken: - raise iohandler.IOHandler.IOBroken('Broken') + raise consts.IOBrokenError('Broken') if not self.isOpen(): - raise iohandler.IOHandler.IOClosed('Closed') + raise consts.IOClosedError('Closed') if self._reverseDirection: if not self.writeBuffer: - raise iohandler.IOHandler.IOTimeout('Timeout') + raise consts.IOTimeoutError('Timeout') bytes, self.writeBuffer = self.writeBuffer[ :n], self.writeBuffer[n: ] else: if not self.readBuffer: - raise iohandler.IOHandler.IOTimeout('Timeout') + raise consts.IOTimeoutError('Timeout') bytes, self.readBuffer = self.readBuffer[ :n], self.readBuffer[n: ] return bytes def write(self, bytes): if self._isBroken: - raise iohandler.IOHandler.IOBroken('Broken') + raise consts.IOBrokenError('Broken') if not self.isOpen(): - raise iohandler.IOHandler.IOClosed('Closed') + raise consts.IOClosedError('Closed') self.writeBuffer += bytes def close(self): @@ -68,7 +68,7 @@ self.readBuffer = '' self.writeBuffer = '' else: - raise iohandler.IOHandler.IOClosed('Closed') + raise consts.IOClosedError('Closed') def isOpen(self): return self._isOpen This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |