Пример #1
0
 def _extract_folder(self, data):
     return serialize_folder(
         data['data'].get('name'),
         list_id=data['data'].get('key'),
         parent_id=data['data'].get('parentCollection'),
         id=data['data'].get('key')
     )
Пример #2
0
 def root_folder(self):
     root = serialize_folder(
         'All Documents',
         id='ROOT',
         parent_id='__'
     )
     root['kind'] = 'folder'
     return root
Пример #3
0
    def citation_lists(self, extract_folder):
        """List of CitationList objects, derived from Mendeley folders"""

        folders = self._get_folders()
        # TODO: Verify OAuth access to each folder
        all_documents = serialize_folder("All Documents", id="ROOT", parent_id="__")
        serialized_folders = [extract_folder(each) for each in folders]
        return [all_documents] + serialized_folders
Пример #4
0
    def citation_lists(self, extract_folder):
        """List of CitationList objects, derived from Mendeley folders"""

        folders = self._get_folders()
        # TODO: Verify OAuth access to each folder
        all_documents = serialize_folder('All Documents',
                                         id='ROOT',
                                         parent_id='__')
        serialized_folders = [extract_folder(each) for each in folders]
        return [all_documents] + serialized_folders
Пример #5
0
    def citation_lists(self, extract_folder):
        """List of CitationList objects, derived from Zotero collections"""
        client = self.client

        collections = client.collections()

        all_documents = serialize_folder('All Documents',
                                         id='ROOT',
                                         parent_id='__')

        serialized_folders = [extract_folder(each) for each in collections]

        return [all_documents] + serialized_folders
Пример #6
0
    def citation_lists(self, extract_folder):
        """List of CitationList objects, derived from Zotero collections"""
        client = self.client

        # Note: Pagination is the only way to ensure all of the collections
        #       are retrieved. 100 is the limit per request. This applies
        #       to Mendeley too, though that limit is 500.
        collections = client.collections(limit=100)

        all_documents = serialize_folder('All Documents',
                                         id='ROOT',
                                         parent_id='__')

        serialized_folders = [extract_folder(each) for each in collections]

        return [all_documents] + serialized_folders
Пример #7
0
    def citation_lists(self, extract_folder):
        """List of CitationList objects, derived from Zotero collections"""
        client = self.client

        collections = client.collections()

        all_documents = serialize_folder(
            'All Documents',
            id='ROOT',
            parent_id='__'
        )

        serialized_folders = [
            extract_folder(each)
            for each in collections
        ]

        return [all_documents] + serialized_folders
Пример #8
0
    def citation_lists(self, extract_folder):
        """List of CitationList objects, derived from Zotero collections"""
        client = self.client

        # Note: Pagination is the only way to ensure all of the collections
        #       are retrieved. 100 is the limit per request. This applies
        #       to Mendeley too, though that limit is 500.
        collections = client.collections(limit=100)

        all_documents = serialize_folder(
            'All Documents',
            id='ROOT',
            parent_id='__'
        )

        serialized_folders = [
            extract_folder(each)
            for each in collections
        ]

        return [all_documents] + serialized_folders
Пример #9
0
 def root_folder(self):
     root = serialize_folder('All Documents', id='ROOT', parent_id='__')
     root['kind'] = 'folder'
     return root
Пример #10
0
 def root_folder(self):
     root = serialize_folder("All Documents", id="ROOT", parent_id="__")
     root["kind"] = "folder"
     return root