def import_collectionmembership(self, record): # Don't add non-masters to collections: if record.itemUUID != getMasterAlias(record.itemUUID): return # Don't import Sidebar membership yet if record.collectionID == '@sidebar': return collection = eim.collection_for_name(record.collectionID) collection.add(eim.item_for_uuid(record.itemUUID))
def import_collection(self, record): collection = eim.collection_for_name(record.uuid) if not isinstance(collection, Collection): raise TypeError("An Item was created instead of a Collection") for sidebar_entry in ChandlerApplication.sidebar_entries: if sidebar_entry.collection is collection: break else: sidebar_entry = SidebarEntry(collection=collection) ChandlerApplication.sidebar_entries.add(sidebar_entry) hsv = self.record_rgb_to_hsv(record) if hsv: sidebar_entry.hsv_color = hsv