1 """File transfers.
2 """
3 __docformat__ = 'restructuredtext en'
4
5
6 import os
7
8 from utils import *
9
10
12 """Represents a file transfer.
13 """
14 _ValidateHandle = int
15
18
19 - def _Alter(self, AlterName, Args=None):
20 return self._Owner._Alter('FILETRANSFER', self.Id, AlterName, Args)
21
23 return self._Owner._Property('FILETRANSFER', self.Id, PropName, Set)
24
26 return int(self._Property('BYTESPERSECOND'))
27
28 BytesPerSecond = property(_GetBytesPerSecond,
29 doc="""Transfer speed in bytes per second.
30
31 :type: int
32 """)
33
35 return long(self._Property('BYTESTRANSFERRED'))
36
37 BytesTransferred = property(_GetBytesTransferred,
38 doc="""Number of bytes transferred.
39
40 :type: long
41 """)
42
44 return str(self._Property('FAILUREREASON'))
45
46 FailureReason = property(_GetFailureReason,
47 doc="""Transfer failure reason.
48
49 :type: `enums`.fileTransferFailureReason*
50 """)
51
54
55 FileName = property(_GetFileName,
56 doc="""Name of the transferred file.
57
58 :type: str
59 """)
60
63
64 FilePath = property(_GetFilePath,
65 doc="""Full path to the transferred file.
66
67 :type: str
68 """)
69
71 return long(self._Property('FILESIZE'))
72
73 FileSize = property(_GetFileSize,
74 doc="""Size of the transferred file in bytes.
75
76 :type: long
77 """)
78
80 from datetime import datetime
81 return datetime.fromtimestamp(self.FinishTime)
82
83 FinishDatetime = property(_GetFinishDatetime,
84 doc="""File transfer end date and time.
85
86 :type: datetime.datetime
87 """)
88
90 return float(self._Property('FINISHTIME'))
91
92 FinishTime = property(_GetFinishTime,
93 doc="""File transfer end timestamp.
94
95 :type: float
96 """)
97
100
101 Id = property(_GetId,
102 doc="""Unique file transfer Id.
103
104 :type: int
105 """)
106
108 return self._Property('PARTNER_DISPNAME')
109
110 PartnerDisplayName = property(_GetPartnerDisplayName,
111 doc="""File transfer partner DisplayName.
112
113 :type: unicode
114 """)
115
117 return str(self._Property('PARTNER_HANDLE'))
118
119 PartnerHandle = property(_GetPartnerHandle,
120 doc="""File transfer partner Skypename.
121
122 :type: str
123 """)
124
126 from datetime import datetime
127 return datetime.fromtimestamp(self.StartTime)
128
129 StartDatetime = property(_GetStartDatetime,
130 doc="""File transfer start date and time.
131
132 :type: datetime.datetime
133 """)
134
136 return float(self._Property('STARTTIME'))
137
138 StartTime = property(_GetStartTime,
139 doc="""File transfer start timestamp.
140
141 :type: float
142 """)
143
145 return str(self._Property('STATUS'))
146
147 Status = property(_GetStatus,
148 doc="""File transfer status.
149
150 :type: `enums`.fileTransferStatus*
151 """)
152
154 return str(self._Property('TYPE'))
155
156 Type = property(_GetType,
157 doc="""File transfer type.
158
159 :type: `enums`.fileTransferType*
160 """)
161
162
165