Thread: SF.net SVN: fclient: [327] trunk/sandbox/fcp2/test_fcp/dummy_io.py
Status: Pre-Alpha
Brought to you by:
jurner
From: <ju...@us...> - 2008-03-06 18:25:28
|
Revision: 327 http://fclient.svn.sourceforge.net/fclient/?rev=327&view=rev Author: jurner Date: 2008-03-06 10:25:35 -0800 (Thu, 06 Mar 2008) Log Message: ----------- adjust to iohandler changes 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-03-06 18:25:06 UTC (rev 326) +++ trunk/sandbox/fcp2/test_fcp/dummy_io.py 2008-03-06 18:25:35 UTC (rev 327) @@ -20,7 +20,7 @@ #******************************************************************** # #******************************************************************** -class DummyIO(iohandler.IOObject): +class DummyIO(iohandler.IOObjectBase): def __init__(self, ): self.readBuffer = '' # buffer client reads from This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-03-09 12:56:26
|
Revision: 351 http://fclient.svn.sourceforge.net/fclient/?rev=351&view=rev Author: jUrner Date: 2008-03-09 05:56:27 -0700 (Sun, 09 Mar 2008) Log Message: ----------- fixes and beautification 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-03-09 12:55:05 UTC (rev 350) +++ trunk/sandbox/fcp2/test_fcp/dummy_io.py 2008-03-09 12:56:27 UTC (rev 351) @@ -22,16 +22,18 @@ #******************************************************************** class DummyIO(iohandler.IOObjectBase): - def __init__(self, ): + def __init__(self, **kwargs): self.readBuffer = '' # buffer client reads from self.writeBuffer = '' # buffer client writes to self._isOpen = False self._isBroken = False - self._disallowConnect = False + self._allowConnect = True self._reverseDirection = False def connect(self, **kwargs): + if not self._allowConnect: + raise iohandler.IOConnectFailed('Refused') self._isOpen = True def read(self, n): @@ -58,9 +60,7 @@ self.writeBuffer += bytes def close(self): - self._isBroken = False - self._disallowConnect = False - self._reverseDirection = False + self.reset() if self.isOpen(): self._isOpen = False self.readBuffer = '' @@ -84,13 +84,12 @@ def setBroken(self, flag): self._isBroken = flag - def setDissallowConnect(self, flag): - self.disallowConnect = flag + def setAllowConnect(self, flag): + self._allowConnect = flag def setReverseDirection(self, flag): self._reverseDirection = flag - def sendResponseMessage(self, name, data=None, **params): buf = [name, ] for name, value in params.items(): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-03-10 13:03:49
|
Revision: 356 http://fclient.svn.sourceforge.net/fclient/?rev=356&view=rev Author: jUrner Date: 2008-03-10 06:03:53 -0700 (Mon, 10 Mar 2008) Log Message: ----------- io was broken. fixed now 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-03-10 13:03:44 UTC (rev 355) +++ trunk/sandbox/fcp2/test_fcp/dummy_io.py 2008-03-10 13:03:53 UTC (rev 356) @@ -22,7 +22,7 @@ #******************************************************************** class DummyIO(iohandler.IOObjectBase): - def __init__(self, **kwargs): + def __init__(self): self.readBuffer = '' # buffer client reads from self.writeBuffer = '' # buffer client writes to @@ -60,7 +60,9 @@ self.writeBuffer += bytes def close(self): - self.reset() + self._isBroken = False + self._allowConnect = True + self._reverseDirection = False if self.isOpen(): self._isOpen = False self.readBuffer = '' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-03-11 01:03:28
|
Revision: 361 http://fclient.svn.sourceforge.net/fclient/?rev=361&view=rev Author: jUrner Date: 2008-03-10 18:03:34 -0700 (Mon, 10 Mar 2008) Log Message: ----------- adapts 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-03-11 01:03:20 UTC (rev 360) +++ trunk/sandbox/fcp2/test_fcp/dummy_io.py 2008-03-11 01:03:34 UTC (rev 361) @@ -33,30 +33,30 @@ def connect(self, **kwargs): if not self._allowConnect: - raise iohandler.IOConnectFailed('Refused') + raise iohandler.IOHandler.IOConnectFailed('Refused') self._isOpen = True def read(self, n): if self._isBroken: - raise iohandler.IOBroken('Broken') + raise iohandler.IOHandler.IOBroken('Broken') if not self.isOpen(): - raise iohandler.IOClosed('Closed') + raise iohandler.IOHandler.IOClosed('Closed') if self._reverseDirection: if not self.writeBuffer: - raise iohandler.IOTimeout('Timeout') + raise iohandler.IOHandler.IOTimeout('Timeout') bytes, self.writeBuffer = self.writeBuffer[ :n], self.writeBuffer[n: ] else: if not self.readBuffer: - raise iohandler.IOTimeout('Timeout') + raise iohandler.IOHandler.IOTimeout('Timeout') bytes, self.readBuffer = self.readBuffer[ :n], self.readBuffer[n: ] return bytes def write(self, bytes): if self._isBroken: - raise iohandler.IOBroken('Broken') + raise iohandler.IOHandler.IOBroken('Broken') if not self.isOpen(): - raise iohandler.IOClosed('Closed') + raise iohandler.IOHandler.IOClosed('Closed') self.writeBuffer += bytes def close(self): @@ -68,7 +68,7 @@ self.readBuffer = '' self.writeBuffer = '' else: - raise iohandler.IOClosed('Closed') + raise iohandler.IOHandler.IOClosed('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. |
From: <jU...@us...> - 2008-04-08 10:12:16
|
Revision: 375 http://fclient.svn.sourceforge.net/fclient/?rev=375&view=rev Author: jUrner Date: 2008-04-08 03:11:37 -0700 (Tue, 08 Apr 2008) Log Message: ----------- whitespace 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-08 10:10:08 UTC (rev 374) +++ trunk/sandbox/fcp2/test_fcp/dummy_io.py 2008-04-08 10:11:37 UTC (rev 375) @@ -58,7 +58,7 @@ if not self.isOpen(): raise iohandler.IOHandler.IOClosed('Closed') self.writeBuffer += bytes - + def close(self): self._isBroken = False self._allowConnect = True This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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. |