def getDesktopSelectedStyleId(self):
        response = self._client.citationStyle_selected()

        if (response.status != 200):
            raise MendeleyHttpClient.UnexpectedResponse(response)

        return response.body.citationStyleId
Пример #2
0
    def getCitationStylePresentationType(self):
        response = self._client.citationStylePresentationType()

        if response.status != 200:
            raise MendeleyHttpClient.UnexpectedResponse(response)

        return response.body.presentationType
    def getUserUuid(self):
        response = self._client.userUuid()

        if (response.status != 200):
            raise MendeleyHttpClient.UnexpectedResponse(response)

        return response.body.uuid
    def mendeleyDesktopInfo(self):
        response = self._client.mendeleyDesktopInfo()
        try:
            assert (response.status == 200)
        except:
            raise MendeleyHttpClient.UnexpectedResponse(response)

        result = {"processId": response.body.processId}
        return result
Пример #5
0
 def citation_undoManualFormat(self, fieldCode):
     citationCluster = self._citationClusterFromFieldCode(fieldCode)
     response = self._client.citation_undoManualFormat(citationCluster)
     try:
         assert(response.status == 200)
         fieldCode = self._fieldCodeFromCitationCluster(response.body.citationCluster)
     except:
         raise MendeleyHttpClient.UnexpectedResponse(response)
     return fieldCode
Пример #6
0
 def getFieldCodeFromUuid(self, documentUuid):
     response = self._client.testMethods_citationCluster_getFromUuid(
         {"documentUuid": documentUuid})
     try:
         assert(response.status == 200)
         fieldCode = self._fieldCodeFromCitationCluster(response.body.citationCluster)
     except:
         raise MendeleyHttpClient.UnexpectedResponse(response)
     return fieldCode
Пример #7
0
 def citation_edit_interactive(self, fieldCode, hintText):
     citationCluster = self._citationClusterFromFieldCode(fieldCode)
     citationCluster["citationEditorHint"] = hintText
     response = self._client.citation_edit_interactive(citationCluster)
     try:
         assert(response.status == 200)
         fieldCode = self._fieldCodeFromCitationCluster(response.body.citationCluster)
     except:
         raise MendeleyHttpClient.UnexpectedResponse(response)
     return fieldCode
Пример #8
0
    def citation_choose_interactive(self, hintText):
        response = self._client.citation_choose_interactive(
            {"citationEditorHint": hintText})
        try:
            assert(response.status == 200)
            fieldCode = self._fieldCodeFromCitationCluster(response.body.citationCluster)
        except:
            raise MendeleyHttpClient.UnexpectedResponse(response)

        return fieldCode
Пример #9
0
    def citation_update_interactive(self, fieldCode, formattedText):
        citationCluster = self._citationClusterFromFieldCode(fieldCode)
        citationCluster["formattedText"] = formattedText

        response = self._client.citation_update_interactive(citationCluster)
        try:
            assert(response.status == 200)
            fieldCode = self._fieldCodeFromCitationCluster(response.body.citationCluster)
        except:
            raise MendeleyHttpClient.UnexpectedResponse(response)
        return fieldCode
Пример #10
0
    def wordProcessor_set(self, wordProcessor, version):
        response = self._client.wordProcessor_set({
            "wordProcessor": wordProcessor,
            "version": version
        })

        try:
            assert (response.status == 200)
        except:
            raise MendeleyHttpClient.UnexpectedResponse(response)

        return ""
Пример #11
0
    def citations_merge(self, *fieldCodes):
        clusters = []

        for fieldCode in fieldCodes:
            clusters.append(self._citationClusterFromFieldCode(fieldCode))

        response = self._client.citations_merge({"citationClusters": clusters})
        try:
            assert (response.status == 200)
            mergedFieldCode = \
                self._fieldCodeFromCitationCluster(response.body.citationCluster)
        except:
            raise MendeleyHttpClient.UnexpectedResponse(response)

        return mergedFieldCode