예제 #1
0
    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))
예제 #2
0
    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))
예제 #3
0
    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
예제 #4
0
    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