예제 #1
0
 def _checkFilePathAttribute(self, node, attrName):
     fpath = node.getAttribute(attrName)
     uri = getUriFromFilePath(fpath)
     # Hack alert: we don't want to modify any URIs that contain the 
     # special template directory token.
     if uri and not u"__RAVEN_TEMPLATE_DIR__" in uri: #$NON-NLS-1$
         # decode url if it is in unicode 'quoted' (e.g. %20 etc).
         uri = decodeUri(uri)
         # if needed, convert hostname to IDNA.
         uri = encodeIDNA(uri)
         # re-encode to Raven conention i.e. internally, store content as IDNA (hostname) with Unicode paths
         uri = encodeUri(uri)
         node.setAttribute(attrName, uri )
예제 #2
0
 def _checkFilePathAttribute(self, node, attrName):
     fpath = node.getAttribute(attrName)
     uri = getUriFromFilePath(fpath)
     # Hack alert: we don't want to modify any URIs that contain the
     # special template directory token.
     if uri and not u"__RAVEN_TEMPLATE_DIR__" in uri:  #$NON-NLS-1$
         # decode url if it is in unicode 'quoted' (e.g. %20 etc).
         uri = decodeUri(uri)
         # if needed, convert hostname to IDNA.
         uri = encodeIDNA(uri)
         # re-encode to Raven conention i.e. internally, store content as IDNA (hostname) with Unicode paths
         uri = encodeUri(uri)
         node.setAttribute(attrName, uri)
예제 #3
0
 def openUrlInBrowser(self, url):
     # If the URL contains unicode characters, assume it is an international
     # URL and thus encode it using the 'idna' encoding
     if isUnicodePath(url):
         url = encodeIDNA(url)
     webbrowser.open_new(url)
예제 #4
0
파일: osutil.py 프로젝트: mpm2050/Raven
 def openUrlInBrowser(self, url):
     # If the URL contains unicode characters, assume it is an international
     # URL and thus encode it using the 'idna' encoding
     if isUnicodePath(url):
         url = encodeIDNA(url)
     webbrowser.open_new(url)
예제 #5
0
 def _checkFilePathAttribute(self, node, attrName):
     fpath = node.getAttribute(attrName)
     uri = getUriFromFilePath(fpath)
     if uri:
         uri = encodeIDNA(uri)
         node.setAttribute(attrName, uri )
예제 #6
0
 def _checkFilePathAttribute(self, node, attrName):
     fpath = node.getAttribute(attrName)
     uri = getUriFromFilePath(fpath)
     if uri:
         uri = encodeIDNA(uri)
         node.setAttribute(attrName, uri)