Thread: SF.net SVN: fclient: [267] trunk/sandbox/fcp2/consts.py
Status: Pre-Alpha
Brought to you by:
jurner
From: <ju...@us...> - 2008-02-26 14:43:42
|
Revision: 267 http://fclient.svn.sourceforge.net/fclient/?rev=267&view=rev Author: jurner Date: 2008-02-26 06:43:43 -0800 (Tue, 26 Feb 2008) Log Message: ----------- added Fcp ConfigValueClass and ConfigDataType consts Modified Paths: -------------- trunk/sandbox/fcp2/consts.py Modified: trunk/sandbox/fcp2/consts.py =================================================================== --- trunk/sandbox/fcp2/consts.py 2008-02-26 14:42:33 UTC (rev 266) +++ trunk/sandbox/fcp2/consts.py 2008-02-26 14:43:43 UTC (rev 267) @@ -36,6 +36,45 @@ # errors +class ConfigValueClass: + """Value classes Fcp passes in config messages""" + + Current = 'current' + Default = 'default' + ExpertFlag = 'expertFlag' + ForceWriteFlag = 'forceWriteFlag' + ShortDescription = 'shortDescription' + LongDescription = 'longDescription' + SortOrder = 'sortOrder' + DataType = 'dataType' + + ClassesAll = ( + Current, + Default, + ExpertFlag, + ForceWriteFlag, + ShortDescription, + LongDescription, + SortOrder, + DataType, + ) + + +class ConfigDataType: + """Basic data types in config messages""" + Boolean = 'boolean' + Number = 'number' + String = 'string' + StringArray = 'atringArray' + + TypesAll = ( + Boolean, + Number, + String, + StringArray, + ) + + class FetchError(Exception): """All fetch errors supported by the client""" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ju...@us...> - 2008-02-26 18:58:10
|
Revision: 281 http://fclient.svn.sourceforge.net/fclient/?rev=281&view=rev Author: jurner Date: 2008-02-26 10:53:55 -0800 (Tue, 26 Feb 2008) Log Message: ----------- moved config key sep to consts Modified Paths: -------------- trunk/sandbox/fcp2/consts.py Modified: trunk/sandbox/fcp2/consts.py =================================================================== --- trunk/sandbox/fcp2/consts.py 2008-02-26 18:52:56 UTC (rev 280) +++ trunk/sandbox/fcp2/consts.py 2008-02-26 18:53:55 UTC (rev 281) @@ -36,6 +36,9 @@ # errors + +ConfigKeySep = '.' + class ConfigValueClass: """Value classes Fcp passes in config messages""" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ju...@us...> - 2008-02-27 00:13:10
|
Revision: 285 http://fclient.svn.sourceforge.net/fclient/?rev=285&view=rev Author: jurner Date: 2008-02-26 16:13:16 -0800 (Tue, 26 Feb 2008) Log Message: ----------- beautifications Modified Paths: -------------- trunk/sandbox/fcp2/consts.py Modified: trunk/sandbox/fcp2/consts.py =================================================================== --- trunk/sandbox/fcp2/consts.py 2008-02-27 00:13:02 UTC (rev 284) +++ trunk/sandbox/fcp2/consts.py 2008-02-27 00:13:16 UTC (rev 285) @@ -30,14 +30,25 @@ #************************************************************************ # #************************************************************************ - +ConfigKeySep = '.' FcpTrue = 'true' FcpFalse = 'false' -# errors +class ConfigDataType: + """Basic data types in config messages""" + Boolean = 'boolean' + Number = 'number' + String = 'string' + StringArray = 'atringArray' + + TypesAll = ( + Boolean, + Number, + String, + StringArray, + ) -ConfigKeySep = '.' class ConfigValueClass: """Value classes Fcp passes in config messages""" @@ -63,21 +74,6 @@ ) -class ConfigDataType: - """Basic data types in config messages""" - Boolean = 'boolean' - Number = 'number' - String = 'string' - StringArray = 'atringArray' - - TypesAll = ( - Boolean, - Number, - String, - StringArray, - ) - - class FetchError(Exception): """All fetch errors supported by the client""" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ju...@us...> - 2008-02-27 12:06:19
|
Revision: 288 http://fclient.svn.sourceforge.net/fclient/?rev=288&view=rev Author: jurner Date: 2008-02-27 04:06:22 -0800 (Wed, 27 Feb 2008) Log Message: ----------- combed over docs Modified Paths: -------------- trunk/sandbox/fcp2/consts.py Modified: trunk/sandbox/fcp2/consts.py =================================================================== --- trunk/sandbox/fcp2/consts.py 2008-02-27 12:05:55 UTC (rev 287) +++ trunk/sandbox/fcp2/consts.py 2008-02-27 12:06:22 UTC (rev 288) @@ -441,25 +441,6 @@ MaskPut = PutData | PutFile | PutDir | PutMultiple | PutRedirect -#TODO: no idea how fcp handles strings as in <Peer volatile.status=CONNECTED> -# all I could find in the sources where these constants as in PEER_NODE_STATUS_CONNECTED -# in --> freenet/node/PeerManager.java -class PeerNodeStatus: - Connected = 1 - RoutingBackedOff = 2 - TooNew = 3 - TooOld = 4 - Disconnected = 5 - NeverConnected = 6 - Disabled = 7 - Bursting = 8 - Listening = 9 - ListenOnly = 10 - ClockProblem = 11 - ConnError = 12 - Disconnecting = 13 - - class PeerNoteType: """All known peer note types""" Private = '1' @@ -480,10 +461,10 @@ class RequestModified(BaseBitFlags): - """Flags indicating what of a request has been modified + """Flags indicating what aspect of a request has been modified @cvar Filename: the filename has been modified @cvar Identifier: the identifier has been moodified - @cvar PersistentUserData: thepersistent user data has been modified + @cvar PersistentUserData: persistent user data has been modified @cvar PriorityClass: the priority class has been modified @note: the FcModified member of the params dict of a request may contain This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ju...@us...> - 2008-02-27 14:13:23
|
Revision: 294 http://fclient.svn.sourceforge.net/fclient/?rev=294&view=rev Author: jurner Date: 2008-02-27 06:13:28 -0800 (Wed, 27 Feb 2008) Log Message: ----------- added debug level quiet Modified Paths: -------------- trunk/sandbox/fcp2/consts.py Modified: trunk/sandbox/fcp2/consts.py =================================================================== --- trunk/sandbox/fcp2/consts.py 2008-02-27 13:52:12 UTC (rev 293) +++ trunk/sandbox/fcp2/consts.py 2008-02-27 14:13:28 UTC (rev 294) @@ -209,6 +209,8 @@ Warning = logging.WARNING Error = logging.ERROR Critical = logging.CRITICAL + Quiet = 1000000 + class DisconnectReason(BaseBitFlags): """Reasons for client disconnect This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ju...@us...> - 2008-02-29 16:25:38
|
Revision: 303 http://fclient.svn.sourceforge.net/fclient/?rev=303&view=rev Author: jurner Date: 2008-02-29 08:25:42 -0800 (Fri, 29 Feb 2008) Log Message: ----------- added consts for time deltas and byte amounts Modified Paths: -------------- trunk/sandbox/fcp2/consts.py Modified: trunk/sandbox/fcp2/consts.py =================================================================== --- trunk/sandbox/fcp2/consts.py 2008-02-29 13:03:27 UTC (rev 302) +++ trunk/sandbox/fcp2/consts.py 2008-02-29 16:25:42 UTC (rev 303) @@ -35,6 +35,33 @@ FcpFalse = 'false' +class ByteAmountPostfix: + Bytes = '' + Kilobytes = 'k' + Kibibytes = 'K' + Megabyres = 'm' + Mebibytes = 'K' + Gigabytes = 'g' + Gibibytes = 'G' + Petabytes = 'p' + Petibytes = 'P' + Exabytes = 'e' + Exibytes = 'E' + + MembersAll = ( + Bytes, + Kilobytes, + Kibibytes, + Megabyres, + Mebibytes, + Gigabytes, + Gibibytes, + Petabytes, + Petibytes, + Exabytes, + Exibytes, + ) + class ConfigDataType: """Basic data types in config messages""" Boolean = 'boolean' @@ -144,55 +171,6 @@ Canceled = 10 -class ProtocolError(Exception): - """All protocol errors supported by the client""" - - def __init__(self, msg): - """ - @param msg: (Message) ProtocolError message or its parameters dict - """ - self.value = '%s (%s, %s)' % ( - msg.get('CodeDescription', 'Unknown error') , - msg['Code'], - msg.get('ExtraDescription', '???'), - ) - def __str__(self): return self.value - - ClientHelloMustBeFirst = 1 - NoLateClientHellos = 2 - MessageParseError = 3 - UriParseError = 4 - MissingField = 5 - ErrorParsingNumber = 6 - InvalidMessage = 7 - InvalidField = 8 - FileNotFound = 9 - DiskTargetExists = 10 # handled: - SameDirectoryExpected = 11 - CouldNotCreateFile = 12 - CouldNotWriteFile = 13 - CouldNotRenameFile = 14 - NoSuchIdentifier = 15 - NotSupported = 16 - InternalError = 17 - ShuttingDown = 18 # handled: - NoSuchNodeIdentifier = 19 # Unused since 995 - UrlParseError = 20 - ReferenceParseError = 21 - FileParseError = 22 - NotAFile = 23 - AccessDenied = 24 - DDADenied = 25 # handled: - CouldNotReadFile = 26 - ReferenceSignature = 27 - CanNotPeerWithSelf = 28 - PeerExists = 29 - OpennetDisabled = 30 - DarknetPeerOnly = 31 - NoSuchPlugin = 32 - -# others - class ConnectReason: """Reason for connecting to the node @cvar Connect: reason is a regualr connect @@ -369,6 +347,54 @@ ClientDisconnected = 'FcClientDisconnected' +class ProtocolError(Exception): + """All protocol errors supported by the client""" + + def __init__(self, msg): + """ + @param msg: (Message) ProtocolError message or its parameters dict + """ + self.value = '%s (%s, %s)' % ( + msg.get('CodeDescription', 'Unknown error') , + msg['Code'], + msg.get('ExtraDescription', '???'), + ) + def __str__(self): return self.value + + ClientHelloMustBeFirst = 1 + NoLateClientHellos = 2 + MessageParseError = 3 + UriParseError = 4 + MissingField = 5 + ErrorParsingNumber = 6 + InvalidMessage = 7 + InvalidField = 8 + FileNotFound = 9 + DiskTargetExists = 10 # handled: + SameDirectoryExpected = 11 + CouldNotCreateFile = 12 + CouldNotWriteFile = 13 + CouldNotRenameFile = 14 + NoSuchIdentifier = 15 + NotSupported = 16 + InternalError = 17 + ShuttingDown = 18 # handled: + NoSuchNodeIdentifier = 19 # Unused since 995 + UrlParseError = 20 + ReferenceParseError = 21 + FileParseError = 22 + NotAFile = 23 + AccessDenied = 24 + DDADenied = 25 # handled: + CouldNotReadFile = 26 + ReferenceSignature = 27 + CanNotPeerWithSelf = 28 + PeerExists = 29 + OpennetDisabled = 30 + DarknetPeerOnly = 31 + NoSuchPlugin = 32 + + class RequestStatus(BaseBitFlags): """Request status flags @cvar Null: no status @@ -416,6 +442,25 @@ Unknown = 'UNKNOWN STATUS' +class PeerNoteType: + """All known peer note types""" + Private = '1' + + +class Persistence: + Connection = 'connection' + Reboot = 'reboot' + Forever = 'forever' + + +class Priority: + Highest = '0' + Higher = '1' + High = '2' + Medium = '3' + Low = '4' + + class RequestType(BaseBitFlags): """Consts indicating the type of a request""" @@ -443,25 +488,6 @@ MaskPut = PutData | PutFile | PutDir | PutMultiple | PutRedirect -class PeerNoteType: - """All known peer note types""" - Private = '1' - - -class Persistence: - Connection = 'connection' - Reboot = 'reboot' - Forever = 'forever' - - -class Priority: - Highest = '0' - Higher = '1' - High = '2' - Medium = '3' - Low = '4' - - class RequestModified(BaseBitFlags): """Flags indicating what aspect of a request has been modified @cvar Filename: the filename has been modified @@ -485,6 +511,24 @@ Nothing = 'none' +class TimeDeltaPostfix: + Second = '' + Minute = 'minute' + Hour = 'hour' + Day = 'day' + Month = 'month' + Year = 'year' + + MembersAll = ( + Second, + Minute, + Hour, + Day, + Month, + Year, + ) + + class UploadFrom: Direct = 'direct' Disk = 'disk' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ju...@us...> - 2008-03-06 11:58:59
|
Revision: 312 http://fclient.svn.sourceforge.net/fclient/?rev=312&view=rev Author: jurner Date: 2008-03-06 03:59:02 -0800 (Thu, 06 Mar 2008) Log Message: ----------- bit of this and that Modified Paths: -------------- trunk/sandbox/fcp2/consts.py Modified: trunk/sandbox/fcp2/consts.py =================================================================== --- trunk/sandbox/fcp2/consts.py 2008-03-06 11:58:32 UTC (rev 311) +++ trunk/sandbox/fcp2/consts.py 2008-03-06 11:59:02 UTC (rev 312) @@ -197,6 +197,7 @@ @cvar DuplicateClientName: another client opend a connection with the same connection name @cvar Shutdown: regular shutdown of the connection @cvar SocketDied: connection to the node died unexpectingly + @cvar SocketShutdown: the node shut down the connection unexpectingly @cvar VersionMissmatch: node or Fcp version did not match """ Close = 0x0 @@ -204,7 +205,9 @@ DuplicateClientName = 0x2 Shutdown = 0x4 SocketDied = 0x8 - VersionMissmatch = 0x10 + SocketShutdown = 0x10 + VersionMissmatch = 0x20 + UnknownNodeHello = 0x40 class FilenameCollision(BaseBitFlags): @@ -251,20 +254,29 @@ ClientRuntime = Client + '.Runtime' Config = Fcp + '.Config' + ClientIOHandler = Client + '.IOHandler' + + + + + class LogMessages: """Strings used for log infos""" - Connecting = 'connecting to node...' + Connecting = 'connecting' Connected = 'connected to node' - ConnectionRetry = 'connecting to node failed... retrying' ConnectingFailed = 'connecting to node failed' + Retry = 'Retrying' - ClientClose = 'closing client' + Closing = 'Closing' - MessageSend = 'send' - MessageReceived = 'received' + Sending = 'Sending' + Received = 'Received' + SocketDied = 'Socket died' + SocketShutdown = 'Socket shutdown by node' + KeyboardInterrupt = 'keyboard interrupt' # kick out SocketDied = 'socket died' AllRequestsCompleted = 'All requests completed' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ju...@us...> - 2008-03-06 17:44:50
|
Revision: 323 http://fclient.svn.sourceforge.net/fclient/?rev=323&view=rev Author: jurner Date: 2008-03-06 09:44:51 -0800 (Thu, 06 Mar 2008) Log Message: ----------- new logger name for iohandler Modified Paths: -------------- trunk/sandbox/fcp2/consts.py Modified: trunk/sandbox/fcp2/consts.py =================================================================== --- trunk/sandbox/fcp2/consts.py 2008-03-06 17:44:00 UTC (rev 322) +++ trunk/sandbox/fcp2/consts.py 2008-03-06 17:44:51 UTC (rev 323) @@ -248,18 +248,14 @@ @cvar Config: logs config related information """ Fcp = 'Fcp' + Client = Fcp + '.Client' ClientEvents = Client + '.Events' - ClientMessages = Client + '.Messages' ClientRuntime = Client + '.Runtime' Config = Fcp + '.Config' - ClientIOHandler = Client + '.IOHandler' + IOHandler = Fcp + '.IOHandler' - - - - class LogMessages: """Strings used for log infos""" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-03-07 09:53:45
|
Revision: 330 http://fclient.svn.sourceforge.net/fclient/?rev=330&view=rev Author: jUrner Date: 2008-03-07 01:53:48 -0800 (Fri, 07 Mar 2008) Log Message: ----------- more log messages Modified Paths: -------------- trunk/sandbox/fcp2/consts.py Modified: trunk/sandbox/fcp2/consts.py =================================================================== --- trunk/sandbox/fcp2/consts.py 2008-03-07 09:53:17 UTC (rev 329) +++ trunk/sandbox/fcp2/consts.py 2008-03-07 09:53:48 UTC (rev 330) @@ -264,7 +264,6 @@ Connected = 'connected to node' ConnectingFailed = 'connecting to node failed' Retry = 'Retrying' - Closing = 'Closing' Sending = 'Sending' @@ -278,6 +277,9 @@ AllRequestsCompleted = 'All requests completed' EventTriggered = 'triggered: ' + + RequestInvalidClientToken = 'Request invalid client token' + class Message: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-03-08 11:14:24
|
Revision: 343 http://fclient.svn.sourceforge.net/fclient/?rev=343&view=rev Author: jUrner Date: 2008-03-08 03:14:24 -0800 (Sat, 08 Mar 2008) Log Message: ----------- beautifications Modified Paths: -------------- trunk/sandbox/fcp2/consts.py Modified: trunk/sandbox/fcp2/consts.py =================================================================== --- trunk/sandbox/fcp2/consts.py 2008-03-08 11:13:42 UTC (rev 342) +++ trunk/sandbox/fcp2/consts.py 2008-03-08 11:14:24 UTC (rev 343) @@ -268,6 +268,7 @@ Sending = 'Sending' Received = 'Received' + CreatingNewMessageType = 'Creating new message type' SocketDied = 'Socket died' SocketShutdown = 'Socket shutdown by node' @@ -405,35 +406,6 @@ NoSuchPlugin = 32 -class RequestStatus(BaseBitFlags): - """Request status flags - @cvar Null: no status - @cvar Restored: the request was restored when the client was started - @cvar Compressing: the request is about to be compressed - @cvar Compressed: compressing is completed - @cvar Success: the request has completed successfuly - @cvar Error: the request has completed with an error - @cvar Removed: the request is completed because it will be or has been removed - - @cvar Completed: processing of the request is completed - @cvar RemovedFromQueue: the request is no longer present in the nodes queue. The client will remove the request - from its own queue as soon as all event listeners have been notified. - - @note: the FcStatus member of the params dict of a request should contain one or more - of the bitflags it picked up while running through the client. - """ - Null = 0x0 - Restored = 0x1 - Compressing = 0x2 - Compressed = 0x4 - Success = 0x8 - Error = 0x10 - Removed = 0x20 - - Completed =0x10000000 - RemovedFromQueue = 0x2000000 - - class PeerNodeStatus: Connected = 'CONNECTED' BackedOff = 'BACKED OFF' @@ -471,6 +443,52 @@ Low = '4' +class RequestModified(BaseBitFlags): + """Flags indicating what aspect of a request has been modified + @cvar Filename: the filename has been modified + @cvar Identifier: the identifier has been moodified + @cvar PersistentUserData: persistent user data has been modified + @cvar PriorityClass: the priority class has been modified + + @note: the FcModified member of the params dict of a request may contain + one or more of the bitflags + """ + Null = 0x0 + Filename = 0x8 + Identifier = 0x4 + PersistentUserData = 0x1 + PriorityClass = 0x2 + + +class RequestStatus(BaseBitFlags): + """Request status flags + @cvar Null: no status + @cvar Restored: the request was restored when the client was started + @cvar Compressing: the request is about to be compressed + @cvar Compressed: compressing is completed + @cvar Success: the request has completed successfuly + @cvar Error: the request has completed with an error + @cvar Removed: the request is completed because it will be or has been removed + + @cvar Completed: processing of the request is completed + @cvar RemovedFromQueue: the request is no longer present in the nodes queue. The client will remove the request + from its own queue as soon as all event listeners have been notified. + + @note: the FcStatus member of the params dict of a request should contain one or more + of the bitflags it picked up while running through the client. + """ + Null = 0x0 + Restored = 0x1 + Compressing = 0x2 + Compressed = 0x4 + Success = 0x8 + Error = 0x10 + Removed = 0x20 + + Completed =0x10000000 + RemovedFromQueue = 0x2000000 + + class RequestType(BaseBitFlags): """Consts indicating the type of a request""" @@ -496,24 +514,9 @@ MaskGenerateKeypair = GenerateSSKKeypair | GenerateUSKKeypair MaskPlugin = PluginInfo | PluginMessage MaskPut = PutData | PutFile | PutDir | PutMultiple | PutRedirect + -class RequestModified(BaseBitFlags): - """Flags indicating what aspect of a request has been modified - @cvar Filename: the filename has been modified - @cvar Identifier: the identifier has been moodified - @cvar PersistentUserData: persistent user data has been modified - @cvar PriorityClass: the priority class has been modified - - @note: the FcModified member of the params dict of a request may contain - one or more of the bitflags - """ - Null = 0x0 - Filename = 0x8 - Identifier = 0x4 - PersistentUserData = 0x1 - PriorityClass = 0x2 - class ReturnType: Direct = 'direct' 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:55:12
|
Revision: 350 http://fclient.svn.sourceforge.net/fclient/?rev=350&view=rev Author: jUrner Date: 2008-03-09 05:55:05 -0700 (Sun, 09 Mar 2008) Log Message: ----------- many comb overs Modified Paths: -------------- trunk/sandbox/fcp2/consts.py Modified: trunk/sandbox/fcp2/consts.py =================================================================== --- trunk/sandbox/fcp2/consts.py 2008-03-09 12:54:35 UTC (rev 349) +++ trunk/sandbox/fcp2/consts.py 2008-03-09 12:55:05 UTC (rev 350) @@ -192,24 +192,27 @@ class DisconnectReason(BaseBitFlags): """Reasons for client disconnect - @cvar Close: the clent has been closed - @cvar ConnectingFailed: connection could not be established + @cvar Close: the clent is about to close down + @cvar ConnectionDied: the connection died unexpectedly @cvar DuplicateClientName: another client opend a connection with the same connection name - @cvar Shutdown: regular shutdown of the connection - @cvar SocketDied: connection to the node died unexpectingly - @cvar SocketShutdown: the node shut down the connection unexpectingly - @cvar VersionMissmatch: node or Fcp version did not match + @cvar IOConnectFailed: io connection could not be established + @cvar NodeClosing: freenet node is closing down + @cvar NoNodeHello: NodeHello message did not arrive in time + @cvar Reconnect: the clent is about to be reconnected + @cvar UnknonNodeHello: some unknow message insteadof NodeHello was encountered durin g connect + @cvar VersionMissmatch: nodebuild or Fcp version did not match """ - Close = 0x0 - ConnectingFailed = 0x1 - DuplicateClientName = 0x2 - Shutdown = 0x4 - SocketDied = 0x8 - SocketShutdown = 0x10 - VersionMissmatch = 0x20 - UnknownNodeHello = 0x40 + Close = 0 + ConnectionDied = 1 + DuplicateClientName = 2 + IOConnectFailed = 3 + NodeClosing = 4 + NoNodeHello = 5 + Reconnect = 6 + UnknownNodeHello = 7 + VersionMissmatch = 8 + - class FilenameCollision(BaseBitFlags): """Filename collision flags @cvar HandleNever: don't handle filename collisions @@ -272,6 +275,7 @@ SocketDied = 'Socket died' SocketShutdown = 'Socket shutdown by node' + CaughtException = 'Caught exception' KeyboardInterrupt = 'keyboard interrupt' # kick out SocketDied = 'socket died' @@ -279,7 +283,7 @@ EventTriggered = 'triggered: ' - RequestInvalidClientToken = 'Request invalid client token' + InvalidPersistentParams = 'Invalid peristent params' 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:03:41
|
Revision: 368 http://fclient.svn.sourceforge.net/fclient/?rev=368&view=rev Author: jUrner Date: 2008-04-08 03:03:38 -0700 (Tue, 08 Apr 2008) Log Message: ----------- some consts where missing Modified Paths: -------------- trunk/sandbox/fcp2/consts.py Modified: trunk/sandbox/fcp2/consts.py =================================================================== --- trunk/sandbox/fcp2/consts.py 2008-03-11 11:21:11 UTC (rev 367) +++ trunk/sandbox/fcp2/consts.py 2008-04-08 10:03:38 UTC (rev 368) @@ -445,6 +445,8 @@ High = '2' Medium = '3' Low = '4' + Lower = '5' + Lowest = '6' class RequestModified(BaseBitFlags): 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:30:05
|
Revision: 378 http://fclient.svn.sourceforge.net/fclient/?rev=378&view=rev Author: jUrner Date: 2008-04-09 00:30:07 -0700 (Wed, 09 Apr 2008) Log Message: ----------- moved errors and loggers to consts for easier access Modified Paths: -------------- trunk/sandbox/fcp2/consts.py Modified: trunk/sandbox/fcp2/consts.py =================================================================== --- trunk/sandbox/fcp2/consts.py 2008-04-08 21:43:58 UTC (rev 377) +++ trunk/sandbox/fcp2/consts.py 2008-04-09 07:30:07 UTC (rev 378) @@ -3,6 +3,48 @@ """Freennet Client Protocol consts and type mappings""" import logging +#***************************************************************************** +# exceptions +#***************************************************************************** +class MessageParseError(Exception): + """Exception raised when a message could not be parsed succesfuly""" + def __init__(self, message, logMethod=None): + if logMethod is not None: + logMethod(self.__class__.__name__ + message) + Exception.__init__(self, message) + + +class IOConnectFailedError(Exception): + """Exception raised if the object can not be connected""" + def __init__(self, message, logMethod=None): + if logMethod is not None: + logMethod(self.__class__.__name__ + message) + Exception.__init__(self, message) + + +class IOClosedError(Exception): + """Exception raised if the object is closed""" + def __init__(self, message, logMethod=None): + if logMethod is not None: + logMethod(self.__class__.__name__ + message) + Exception.__init__(self, message) + + +class IOBrokenError(Exception): + """Exception raised if the IO connection is broken""" + def __init__(self, message, logMethod=None): + if logMethod is not None: + logMethod(self.__class__.__name__ + message) + Exception.__init__(self, message) + + +class IOTimeoutError(Exception): + """Exception raised when the io connection is closed""" + def __init__(self, message, logMethod=None): + if logMethod is not None: + logMethod(self.__class__.__name__ + message) + Exception.__init__(self, message) + #************************************************************************ # #************************************************************************ @@ -238,27 +280,16 @@ Invalid = '' TypesAll = (SSK, KSK, CHK, USK, SVK) + +class Logger: + """Package loggers""" + Fcp = logging.getLogger('Fcp') + Client = logging.getLogger('Fcp.Client') + Event = logging.getLogger('Fcp.Client.Event') + IOHandler =logging.getLogger('Fcp.Client.IOHandler') + IO =logging.getLogger('Fcp.Client.IOHandler.IO') + Message = logging.getLogger('Fcp.Client.Message') -class LoggerNames: - """Logger names used by the the package - - @cvar Fcp: root logger for the packsge - @cvar Client: root logger for the client - @cvar ClientEvents: logs events the client emits - @cvar ClientMessages: logs messages the client sends and receives - @cvar ClientRuntime: logs runtime information - - @cvar Config: logs config related information - """ - Fcp = 'Fcp' - - Client = Fcp + '.Client' - ClientEvents = Client + '.Events' - ClientRuntime = Client + '.Runtime' - Config = Fcp + '.Config' - - IOHandler = Fcp + '.IOHandler' - class LogMessages: """Strings used for log infos""" 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:44:36
|
Revision: 384 http://fclient.svn.sourceforge.net/fclient/?rev=384&view=rev Author: jUrner Date: 2008-04-09 00:44:40 -0700 (Wed, 09 Apr 2008) Log Message: ----------- moved more logging stuff to consts Modified Paths: -------------- trunk/sandbox/fcp2/consts.py Modified: trunk/sandbox/fcp2/consts.py =================================================================== --- trunk/sandbox/fcp2/consts.py 2008-04-09 07:35:09 UTC (rev 383) +++ trunk/sandbox/fcp2/consts.py 2008-04-09 07:44:40 UTC (rev 384) @@ -3,6 +3,7 @@ """Freennet Client Protocol consts and type mappings""" import logging +import sys #***************************************************************************** # exceptions #***************************************************************************** @@ -285,12 +286,16 @@ """Package loggers""" Fcp = logging.getLogger('Fcp') Client = logging.getLogger('Fcp.Client') + Config = logging.getLogger('Fcp.Config') Event = logging.getLogger('Fcp.Client.Event') IOHandler =logging.getLogger('Fcp.Client.IOHandler') IO =logging.getLogger('Fcp.Client.IOHandler.IO') Message = logging.getLogger('Fcp.Client.Message') - +logging.basicConfig(stream=sys.stdout, level=logging.DEBUG) +logging.addLevelName(DebugVerbosity.Quiet, '') + + class LogMessages: """Strings used for log infos""" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-05-05 07:58:51
|
Revision: 400 http://fclient.svn.sourceforge.net/fclient/?rev=400&view=rev Author: jUrner Date: 2008-05-05 00:58:55 -0700 (Mon, 05 May 2008) Log Message: ----------- RemovePersistentRequest is deprecated in Fcp. use RemoveRequest instead. ++ fixes for exceptions Modified Paths: -------------- trunk/sandbox/fcp2/consts.py Modified: trunk/sandbox/fcp2/consts.py =================================================================== --- trunk/sandbox/fcp2/consts.py 2008-05-05 07:57:16 UTC (rev 399) +++ trunk/sandbox/fcp2/consts.py 2008-05-05 07:58:55 UTC (rev 400) @@ -11,7 +11,7 @@ """Exception raised when a message could not be parsed succesfuly""" def __init__(self, message, logMethod=None): if logMethod is not None: - logMethod(self.__class__.__name__ + message) + logMethod(self.__class__.__name__ + ': %s' % message) Exception.__init__(self, message) @@ -19,7 +19,7 @@ """Exception raised if the object can not be connected""" def __init__(self, message, logMethod=None): if logMethod is not None: - logMethod(self.__class__.__name__ + message) + logMethod(self.__class__.__name__ + ': %s' % message) Exception.__init__(self, message) @@ -27,7 +27,7 @@ """Exception raised if the object is closed""" def __init__(self, message, logMethod=None): if logMethod is not None: - logMethod(self.__class__.__name__ + message) + logMethod(self.__class__.__name__ + ': %s' % message) Exception.__init__(self, message) @@ -35,7 +35,7 @@ """Exception raised if the IO connection is broken""" def __init__(self, message, logMethod=None): if logMethod is not None: - logMethod(self.__class__.__name__ + message) + logMethod(self.__class__.__name__ + ': %s' % message) Exception.__init__(self, message) @@ -43,7 +43,7 @@ """Exception raised when the io connection is closed""" def __init__(self, message, logMethod=None): if logMethod is not None: - logMethod(self.__class__.__name__ + message) + logMethod(self.__class__.__name__ + ': %s' % message) Exception.__init__(self, message) #************************************************************************ @@ -348,7 +348,7 @@ ModifyPeerNote = 'ModifyPeerNote' ModifyPersistentRequest = 'ModifyPersistentRequest' RemovePeer = 'RemovePeer' - RemovePersistentRequest = 'RemovePersistentRequest' + RemoveRequest = 'RemoveRequest' Shutdown = 'Shutdown' SubscribeUSK = 'SubscribeUSK' TestDDARequest = 'TestDDARequest' # (since 1027) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-06-28 08:38:58
|
Revision: 413 http://fclient.svn.sourceforge.net/fclient/?rev=413&view=rev Author: jUrner Date: 2008-06-28 01:39:08 -0700 (Sat, 28 Jun 2008) Log Message: ----------- added new PutDirType consts Modified Paths: -------------- trunk/sandbox/fcp2/consts.py Modified: trunk/sandbox/fcp2/consts.py =================================================================== --- trunk/sandbox/fcp2/consts.py 2008-06-28 08:38:50 UTC (rev 412) +++ trunk/sandbox/fcp2/consts.py 2008-06-28 08:39:08 UTC (rev 413) @@ -485,6 +485,11 @@ Lowest = '6' +class PutDirType. + Complex = 'complex' + Disk = 'disk' + + class RequestModified(BaseBitFlags): """Flags indicating what aspect of a request has been modified @cvar Filename: the filename has been modified This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-06-28 08:42:23
|
Revision: 414 http://fclient.svn.sourceforge.net/fclient/?rev=414&view=rev Author: jUrner Date: 2008-06-28 01:42:30 -0700 (Sat, 28 Jun 2008) Log Message: ----------- beautifications Modified Paths: -------------- trunk/sandbox/fcp2/consts.py Modified: trunk/sandbox/fcp2/consts.py =================================================================== --- trunk/sandbox/fcp2/consts.py 2008-06-28 08:39:08 UTC (rev 413) +++ trunk/sandbox/fcp2/consts.py 2008-06-28 08:42:30 UTC (rev 414) @@ -144,6 +144,48 @@ ) +class ConnectReason: + """Reason for connecting to the node + @cvar Connect: reason is a regualr connect + @cvar Reconnect: reason is a reconnect + """ + Connect = 1 + Reconnect = 2 + + +class DebugVerbosity: + """Consts indicating the verbosity level for debugging""" + Debug = logging.DEBUG + Info = logging.INFO + Warning = logging.WARNING + Error = logging.ERROR + Critical = logging.CRITICAL + Quiet = 1000000 + + +class DisconnectReason(BaseBitFlags): + """Reasons for client disconnect + @cvar Close: the clent is about to close down + @cvar ConnectionDied: the connection died unexpectedly + @cvar DuplicateClientName: another client opend a connection with the same connection name + @cvar IOConnectFailed: io connection could not be established + @cvar NodeClosing: freenet node is closing down + @cvar NoNodeHello: NodeHello message did not arrive in time + @cvar Reconnect: the clent is about to be reconnected + @cvar UnknonNodeHello: some unknow message insteadof NodeHello was encountered durin g connect + @cvar VersionMissmatch: nodebuild or Fcp version did not match + """ + Close = 0 + ConnectionDied = 1 + DuplicateClientName = 2 + IOConnectFailed = 3 + NodeClosing = 4 + NoNodeHello = 5 + Reconnect = 6 + UnknownNodeHello = 7 + VersionMissmatch = 8 + + class FetchError(Exception): """All fetch errors supported by the client""" @@ -188,6 +230,21 @@ NotAllDataFound = 28 +class FilenameCollision(BaseBitFlags): + """Filename collision flags + @cvar HandleNever: don't handle filename collisions + @cvar HandleRename: rename file on collisions + @cvar MaskHandle: bitmask indicating if collisions are hadled or not + @cvar CollisonHandled: if this bit is set, a collision has actually been handled + """ + HandleNever = 0x0 + HandleRename = 0x1 + + MaskHandle = HandleRename + + CollisionHandled = 0x10000000 # a filename collision has already been handled + + class InsertError(Exception): """All insert errors supported by the client""" @@ -214,63 +271,6 @@ Canceled = 10 -class ConnectReason: - """Reason for connecting to the node - @cvar Connect: reason is a regualr connect - @cvar Reconnect: reason is a reconnect - """ - Connect = 1 - Reconnect = 2 - - -class DebugVerbosity: - """Consts indicating the verbosity level for debugging""" - Debug = logging.DEBUG - Info = logging.INFO - Warning = logging.WARNING - Error = logging.ERROR - Critical = logging.CRITICAL - Quiet = 1000000 - - -class DisconnectReason(BaseBitFlags): - """Reasons for client disconnect - @cvar Close: the clent is about to close down - @cvar ConnectionDied: the connection died unexpectedly - @cvar DuplicateClientName: another client opend a connection with the same connection name - @cvar IOConnectFailed: io connection could not be established - @cvar NodeClosing: freenet node is closing down - @cvar NoNodeHello: NodeHello message did not arrive in time - @cvar Reconnect: the clent is about to be reconnected - @cvar UnknonNodeHello: some unknow message insteadof NodeHello was encountered durin g connect - @cvar VersionMissmatch: nodebuild or Fcp version did not match - """ - Close = 0 - ConnectionDied = 1 - DuplicateClientName = 2 - IOConnectFailed = 3 - NodeClosing = 4 - NoNodeHello = 5 - Reconnect = 6 - UnknownNodeHello = 7 - VersionMissmatch = 8 - - -class FilenameCollision(BaseBitFlags): - """Filename collision flags - @cvar HandleNever: don't handle filename collisions - @cvar HandleRename: rename file on collisions - @cvar MaskHandle: bitmask indicating if collisions are hadled or not - @cvar CollisonHandled: if this bit is set, a collision has actually been handled - """ - HandleNever = 0x0 - HandleRename = 0x1 - - MaskHandle = HandleRename - - CollisionHandled = 0x10000000 # a filename collision has already been handled - - class KeyType: """Supported key types""" SSK = 'SSK@' @@ -398,6 +398,44 @@ ClientDisconnected = 'FcClientDisconnected' +class PeerNodeStatus: + Connected = 'CONNECTED' + BackedOff = 'BACKED OFF' + TooNew = 'TOO NEW' + TooOld = 'TOO OLD' + Disconnected = 'DISCONNECTED' + NeverConnected = 'NEVER CONNECTED' + Disabled = 'DISABLED' + ClockProblem = 'CLOCK PROBLEM' + ConnectionError = 'CONNECTION ERROR' + RoutingDisabled = 'ROUTING DISABLED' + ListenOnly = 'LISTEN ONLY' + Listening = 'LISTENING' + Bursting = 'BURSTING' + Disconnecting = 'DISCONNECTING' + Unknown = 'UNKNOWN STATUS' + + +class PeerNoteType: + """All known peer note types""" + Private = '1' + + +class Persistence: + Connection = 'connection' + Reboot = 'reboot' + Forever = 'forever' + +class Priority: + Highest = '0' + Higher = '1' + High = '2' + Medium = '3' + Low = '4' + Lower = '5' + Lowest = '6' + + class ProtocolError(Exception): """All protocol errors supported by the client""" @@ -446,46 +484,7 @@ NoSuchPlugin = 32 -class PeerNodeStatus: - Connected = 'CONNECTED' - BackedOff = 'BACKED OFF' - TooNew = 'TOO NEW' - TooOld = 'TOO OLD' - Disconnected = 'DISCONNECTED' - NeverConnected = 'NEVER CONNECTED' - Disabled = 'DISABLED' - ClockProblem = 'CLOCK PROBLEM' - ConnectionError = 'CONNECTION ERROR' - RoutingDisabled = 'ROUTING DISABLED' - ListenOnly = 'LISTEN ONLY' - Listening = 'LISTENING' - Bursting = 'BURSTING' - Disconnecting = 'DISCONNECTING' - Unknown = 'UNKNOWN STATUS' - - -class PeerNoteType: - """All known peer note types""" - Private = '1' - - -class Persistence: - Connection = 'connection' - Reboot = 'reboot' - Forever = 'forever' - - -class Priority: - Highest = '0' - Higher = '1' - High = '2' - Medium = '3' - Low = '4' - Lower = '5' - Lowest = '6' - - -class PutDirType. +class PutDirType: Complex = 'complex' Disk = 'disk' @@ -561,10 +560,8 @@ MaskGenerateKeypair = GenerateSSKKeypair | GenerateUSKKeypair MaskPlugin = PluginInfo | PluginMessage MaskPut = PutData | PutFile | PutDir | PutMultiple | PutRedirect - - class ReturnType: Direct = 'direct' Disk = 'disk' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-06-29 15:19:01
|
Revision: 425 http://fclient.svn.sourceforge.net/fclient/?rev=425&view=rev Author: jUrner Date: 2008-06-29 08:19:09 -0700 (Sun, 29 Jun 2008) Log Message: ----------- more fine grained logging support Modified Paths: -------------- trunk/sandbox/fcp2/consts.py Modified: trunk/sandbox/fcp2/consts.py =================================================================== --- trunk/sandbox/fcp2/consts.py 2008-06-29 15:18:28 UTC (rev 424) +++ trunk/sandbox/fcp2/consts.py 2008-06-29 15:19:09 UTC (rev 425) @@ -7,44 +7,29 @@ #***************************************************************************** # exceptions #***************************************************************************** -class MessageParseError(Exception): - """Exception raised when a message could not be parsed succesfuly""" - def __init__(self, message, logMethod=None): +class FcpError(Exception): + def __init__(self, message, logMethod=None, logLevel=None): if logMethod is not None: - logMethod(self.__class__.__name__ + ': %s' % message) + if logLevel is None: + logMethod(self.__class__.__name__ + ': %s' % message) + else: + logMethod(logLevel, self.__class__.__name__ + ': %s' % message) Exception.__init__(self, message) - -class IOConnectFailedError(Exception): +class MessageParseError(FcpError): + """Exception raised when a message could not be parsed succesfuly""" + +class IOConnectFailedError(FcpError): """Exception raised if the object can not be connected""" - def __init__(self, message, logMethod=None): - if logMethod is not None: - logMethod(self.__class__.__name__ + ': %s' % message) - Exception.__init__(self, message) - -class IOClosedError(Exception): +class IOClosedError(FcpError): """Exception raised if the object is closed""" - def __init__(self, message, logMethod=None): - if logMethod is not None: - logMethod(self.__class__.__name__ + ': %s' % message) - Exception.__init__(self, message) - -class IOBrokenError(Exception): +class IOBrokenError(FcpError): """Exception raised if the IO connection is broken""" - def __init__(self, message, logMethod=None): - if logMethod is not None: - logMethod(self.__class__.__name__ + ': %s' % message) - Exception.__init__(self, message) - class IOTimeoutError(Exception): """Exception raised when the io connection is closed""" - def __init__(self, message, logMethod=None): - if logMethod is not None: - logMethod(self.__class__.__name__ + ': %s' % message) - Exception.__init__(self, message) #************************************************************************ # @@ -155,6 +140,7 @@ class DebugVerbosity: """Consts indicating the verbosity level for debugging""" + Chatty = logging.DEBUG - 1 Debug = logging.DEBUG Info = logging.INFO Warning = logging.WARNING @@ -291,11 +277,12 @@ IOHandler =logging.getLogger('Fcp.Client.IOHandler') IO =logging.getLogger('Fcp.Client.IOHandler.IO') Message = logging.getLogger('Fcp.Client.Message') - +logging.addLevelName(DebugVerbosity.Chatty, 'chatty') +logging.addLevelName(DebugVerbosity.Quiet, 'quiet') logging.basicConfig(stream=sys.stdout, level=logging.DEBUG) -logging.addLevelName(DebugVerbosity.Quiet, '') + class LogMessages: """Strings used for log infos""" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |