コード例 #1
0
 def analyseElement(self, node):
     if node.localName.lower() == u"a": #$NON-NLS-1$
         href = node.getAttribute(u"href") #$NON-NLS-1$
         rel = node.getAttribute(u"rel").lower() #$NON-NLS-1$
         if rel.find(u"tag") == -1:#$NON-NLS-1$
             return
         (host, path) = getHostAndPath(href) #@UnusedVariable
         if not path:
             return
         pathparts = path.split(u"/") #$NON-NLS-1$
         tag = pathparts[-1].strip()
         if not tag:
             return
         try:
             self.tagwords.append(unquote_plus(tag))
         except:
             # ignore any conversion errors (for now)
             pass
コード例 #2
0
ファイル: xhtmlanalyzers.py プロジェクト: mpm2050/Raven
 def analyseElement(self, node):
     if node.localName.lower() == u"a":  #$NON-NLS-1$
         href = node.getAttribute(u"href")  #$NON-NLS-1$
         rel = node.getAttribute(u"rel").lower()  #$NON-NLS-1$
         if rel.find(u"tag") == -1:  #$NON-NLS-1$
             return
         (host, path) = getHostAndPath(href)  #@UnusedVariable
         if not path:
             return
         pathparts = path.split(u"/")  #$NON-NLS-1$
         tag = pathparts[-1].strip()
         if not tag:
             return
         try:
             self.tagwords.append(unquote_plus(tag))
         except:
             # ignore any conversion errors (for now)
             pass
コード例 #3
0
ファイル: win32.py プロジェクト: mpm2050/Raven
 def onLinkClick(self, event):
     url = getSafeString( event.getHref() )
     if url.lower().startswith(u"http"): #$NON-NLS-1$
         url = unquote_plus(url)
         osutil = getOSUtil()
         osutil.openUrlInBrowser(url)
コード例 #4
0
 def getSrc(self):
     return unquote_plus(self.element.getAttribute(u"src")) #$NON-NLS-1$
コード例 #5
0
 def getHref(self):
     return unquote_plus(self.element.getAttribute(u"href")) #$NON-NLS-1$