MCPcopy
hub / github.com/pimutils/vdirsyncer / list

Method list

vdirsyncer/storage/singlefile.py:97–118  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

95 return kwargs
96
97 def list(self):
98 self._items = collections.OrderedDict()
99
100 try:
101 self._last_etag = get_etag_from_file(self.path)
102 with open(self.path, self._read_mode) as f:
103 text = f.read().decode(self.encoding)
104 except OSError as e:
105 import errno
106 if e.errno != errno.ENOENT: # file not found
107 raise OSError(e)
108 text = None
109
110 if not text:
111 return ()
112
113 for item in split_collection(text):
114 item = Item(item)
115 etag = item.hash
116 self._items[item.ident] = item, etag
117
118 return ((href, etag) for href, (item, etag) in self._items.items())
119
120 def get(self, href):
121 if self._items is None or not self._at_once:

Callers 3

getMethod · 0.95
at_onceMethod · 0.95
innerFunction · 0.45

Calls 3

get_etag_from_fileFunction · 0.85
split_collectionFunction · 0.85
ItemClass · 0.85

Tested by

no test coverage detected