SF.net SVN: fclient: [414] trunk/sandbox/fcp2/consts.py
Status: Pre-Alpha
Brought to you by:
jurner
|
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.
|