Kaydet (Commit) 6191a235 authored tarafından Ka-Ping Yee's avatar Ka-Ping Yee

Use nturl2path to generate a file: URL to source files in Windows.

üst 79fa2b60
...@@ -484,7 +484,11 @@ TT { font-family: lucida typewriter, lucida console, courier } ...@@ -484,7 +484,11 @@ TT { font-family: lucida typewriter, lucida console, courier }
head = '<big><big><strong>%s</strong></big></big>' % linkedname head = '<big><big><strong>%s</strong></big></big>' % linkedname
try: try:
path = inspect.getabsfile(object) path = inspect.getabsfile(object)
filelink = '<a href="file:%s">%s</a>' % (path, path) url = path
if sys.platform == 'win32':
import nturl2path
url = nturl2path.pathname2url(path)
filelink = '<a href="file:%s">%s</a>' % (url, path)
except TypeError: except TypeError:
filelink = '(built-in)' filelink = '(built-in)'
info = [] info = []
...@@ -1473,9 +1477,9 @@ class ModuleScanner(Scanner): ...@@ -1473,9 +1477,9 @@ class ModuleScanner(Scanner):
return children return children
def isnewpackage(self, (dir, package)): def isnewpackage(self, (dir, package)):
inode = os.stat(dir)[1] # detect circular symbolic links inode = os.path.exists(dir) and os.stat(dir)[1]
if not (os.path.islink(dir) and inode in self.inodes): if not (os.path.islink(dir) and inode in self.inodes):
self.inodes.append(inode) self.inodes.append(inode) # detect circular symbolic links
return ispackage(dir) return ispackage(dir)
def run(self, callback, key=None, completer=None): def run(self, callback, key=None, completer=None):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment