License GNU General Public License, version 3
Lines 58
Included in this Library
Permissions
Owner: wildintellect
Viewable by Everyone
Editable by All Siafoo Users
Hide
Don't get spied on – We respect your privacy and provide numerous options to protect it. Join Siafoo Now or Learn More

transport.py Atom Feed 0

# 's
 1"""
2transport.py - Transport interface for StandardConnection
3"""
4import sys
5sys.path.append("..")
6
7class TimeoutError( Exception ):
8 """
9 A read/write that failed due to a timeout
10 """
11 pass
12
13class WriteError( Exception ):
14 """
15 A write that failed for any reason except timeout
16 """
17 pass
18
19class ReadError( Exception ):
20 """
21 A read that failed for any reason except timeout
22 """
23 pass
24
25class OpenError( Exception ):
26 """
27 An exception in open()
28 """
29 pass
30
31class CloseError( Exception ):
32 """
33 An exception in close()
34 """
35 pass
36
37class InterfaceFileLike( object ):
38 """
39 Interface for all Transport layers
40 """
41 def __init__( self ):
42 super( InterfaceFileLike, self ).__init__()
43
44 def read( self, size ):
45 """
46 read( size ) -> data
47 size is the number of bytes to read.
48 """
49 raise NotImplementedError
50
51 def write( self, data ):
52 """
53 write( string ) -> None
54 """
55 raise NotImplementedError
56
57 def open( self ):
58 """
59 open() -> None
60 """
61 raise NotImplementedError
62
63 def close( self ):
64 """
65 close() -> None
66 """
67 raise NotImplementedError