1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 from caldavclientlibrary.protocol.http.data.data import ResponseData
18 from caldavclientlibrary.protocol.http.data.data import RequestData
19 import stat
20 import os
21
23
24 - def __init__(self, fname, content_type):
25
26
27 self.fname = fname
28
29
30 self.content_length = os.stat(self.fname)[stat.ST_SIZE]
31
32 self.content_type = content_type
33
35
36 self.stream = open(self.fname, "r")
37
39 self.stream.close()
40 self.stream = None
41
48
50
53
55
56 self.stream = open(self.fname, "w")
57
59 self.stream.close()
60 self.stream = None
61
64
69