Beispiel #1
0
 def _analyseZXhtmlImage(self, iZXhtmlImage):
     tnElem = None
     linkElem = None
     if isLocalFile( iZXhtmlImage.getSrc() ):
         # img source points to a local image file.
         tnElem = iZXhtmlImage.getNode()
         if iZXhtmlImage.isLinked():
             # TN is linked. Check to see if the link exists and if it points to a local image
             iZXhtmlLink = iZXhtmlImage.getLink()
             if isLocalFile( iZXhtmlLink.getHref() ):
                 # parent link points to a local file.
                 # check if link is to an image
                 filePath = getFilePathFromUri( iZXhtmlLink.getHref() )
                 (base, ext) = os.path.splitext(filePath) #@UnusedVariable
                 if ext and IMAGE_EXTS.find(ext.strip()) != -1:
                     linkElem = iZXhtmlLink.getNode()
     if tnElem and linkElem:
         # remove TN
         tnElem = tnElem.parentNode.removeChild(tnElem)
         # import TB back to dom
         tnElem = linkElem.ownerDocument.importNode(tnElem, True)
         # replace link if TN
         linkElem.parentNode.replaceChild(tnElem, linkElem)
Beispiel #2
0
 def _analyseZXhtmlImage(self, iZXhtmlImage):
     tnElem = None
     linkElem = None
     if isLocalFile(iZXhtmlImage.getSrc()):
         # img source points to a local image file.
         tnElem = iZXhtmlImage.getNode()
         if iZXhtmlImage.isLinked():
             # TN is linked. Check to see if the link exists and if it points to a local image
             iZXhtmlLink = iZXhtmlImage.getLink()
             if isLocalFile(iZXhtmlLink.getHref()):
                 # parent link points to a local file.
                 # check if link is to an image
                 filePath = getFilePathFromUri(iZXhtmlLink.getHref())
                 (base, ext) = os.path.splitext(filePath)  #@UnusedVariable
                 if ext and IMAGE_EXTS.find(ext.strip()) != -1:
                     linkElem = iZXhtmlLink.getNode()
     if tnElem and linkElem:
         # remove TN
         tnElem = tnElem.parentNode.removeChild(tnElem)
         # import TB back to dom
         tnElem = linkElem.ownerDocument.importNode(tnElem, True)
         # replace link if TN
         linkElem.parentNode.replaceChild(tnElem, linkElem)
 def _analyseZXhtmlImage(self, iZXhtmlImage): #@UnusedVariable
     if isLocalFile( iZXhtmlImage.getSrc() ):
         self.contentList.append( ZBlogDocumentUploadContent(iZXhtmlImage.getNode()) )
 def _analyseZXhtmlLink(self, iZXhtmlLink): #@UnusedVariable
     if isLocalFile( iZXhtmlLink.getHref() ):
         self.contentList.append( ZBlogDocumentUploadContent(iZXhtmlLink.getNode()) )
Beispiel #5
0
 def _analyseZXhtmlImage(self, iZXhtmlImage):  #@UnusedVariable
     if isLocalFile(iZXhtmlImage.getSrc()):
         self.contentList.append(
             ZBlogDocumentUploadContent(iZXhtmlImage.getNode()))
Beispiel #6
0
 def _analyseZXhtmlLink(self, iZXhtmlLink):  #@UnusedVariable
     if isLocalFile(iZXhtmlLink.getHref()):
         self.contentList.append(
             ZBlogDocumentUploadContent(iZXhtmlLink.getNode()))