Beispiel #1
0
    def save(self):
        pagePath = self.getPagePath()
        print("  DROPBOX: saving page to {} ".format(pagePath))

        try:
            exporter = XMLExporter(self.getPageDir(), self.getFilename())
            xmlString = exporter.getXmlString(self.document)

            # NOTE: put_file stores a BINARY file, with no character encoding applied!
            fileData = bytes(xmlString, encoding='utf-8')
            self.notepad.client.put_file(pagePath, fileData, True)
        except ErrorResponse as rsp:
            print(str(rsp))
Beispiel #2
0
    def save(self):
        pagePath = self.getPagePath()
        print("  DROPBOX: saving page to {} ".format(pagePath))

        try:
            exporter = XMLExporter(self.getPageDir(), self.getFilename())
            xmlString = exporter.getXmlString(self.document)

            # NOTE: put_file stores a BINARY file, with no character encoding applied!
            fileData = bytes(xmlString, encoding='utf-8')
            self.notepad.client.put_file(pagePath, fileData, True)
        except ErrorResponse as rsp:
            print(str(rsp))
Beispiel #3
0
    def save(self):
        pagePath = self.getPagePath()
        self.l.debug('Saving page to {}'.format(pagePath))

        pageDir = self.getPageDir()
        if not os.path.isdir(pageDir):
            self.l.debug('{} does not exist, creating directory ...'.format(pageDir))
            os.makedirs(pageDir)

        exporter = XMLExporter(self.getPageDir(), self.getFilename())
        exporter.exportDocument(self.document)

        self.notepad.updateLinks(self.getName(), exporter.getLinks())
        self.document.setModified(False)
Beispiel #4
0
    def save(self):
        pagePath = self.getPagePath()
        self.l.debug('Saving page to {}'.format(pagePath))

        pageDir = self.getPageDir()
        if not os.path.isdir(pageDir):
            self.l.debug(
                '{} does not exist, creating directory ...'.format(pageDir))
            os.makedirs(pageDir)

        exporter = XMLExporter(self.getPageDir(), self.getFilename())
        exporter.exportDocument(self.document)

        self.notepad.updateLinks(self.getName(), exporter.getLinks())
        self.document.setModified(False)
Beispiel #5
0
 def activateXMLView(self):
     exporter = XMLExporter(self.editorWidget.page.getPageDir(), None)
     self.customView.setPlainText(exporter.getXmlString(self.editorWidget.editView.document()))
 def activateXMLView(self):
     exporter = XMLExporter(self.editorWidget.page.getPageDir(), None)
     self.customView.setPlainText(
         exporter.getXmlString(self.editorWidget.editView.document()))