Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions zarafa/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1297,7 +1297,7 @@ def check_folder(folder):
def item(self, entryid):
""" Return :class:`Item` with given entryid; raise exception of not found """ # XXX better exception?

item = Item() # XXX copy-pasting..
item = Item(parent=self) # XXX copy-pasting..
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'self' is a Store, so not really the direct parent of the item.. but note that 'Item.folder' looks up the correct parent folder using PR_PARENT_ENTRYID.

item.store = self
item.server = self.server
item.mapiobj = _openentry_raw(self.mapiobj, entryid.decode('hex'), MAPI_MODIFY)
Expand Down Expand Up @@ -1439,7 +1439,7 @@ def container_class(self, value):
def item(self, entryid):
""" Return :class:`Item` with given entryid; raise exception of not found """ # XXX better exception?

item = Item() # XXX copy-pasting..
item = Item(parent=self) # XXX copy-pasting..
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, so this should work and make things faster. note that in 7.2, we renamed 'parent' into 'folder' for clarity.

item.store = self.store
item.server = self.server
item.mapiobj = _openentry_raw(self.store.mapiobj, entryid.decode('hex'), MAPI_MODIFY)
Expand All @@ -1459,7 +1459,7 @@ def items(self):
if len(rows) == 0:
break
for row in rows:
item = Item()
item = Item(parent=self)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks also fine then.

item.store = self.store
item.server = self.server
item.mapiobj = _openentry_raw(self.store.mapiobj, PpropFindProp(row, PR_ENTRYID).Value, MAPI_MODIFY)
Expand Down Expand Up @@ -1692,6 +1692,8 @@ def __init__(self, parent=None, eml=None, ics=None, vcf=None, load=None, loads=N
self.emlfile = eml
if isinstance(parent, Folder):
self._folder = parent
else:
self._folder = None
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as you noted somewhere this has been fixed already.

# XXX
self._architem = None

Expand Down