rclchm: use posixpath not path when dealing with internal paths

This commit is contained in:
Jean-Francois Dockes 2011-12-27 17:59:33 +01:00
parent 72aac60264
commit 636b935904

View File

@ -4,6 +4,7 @@ Needs at least python 2.2 for HTMLParser (chmlib needs 2.2 too)"""
import sys
import os
import posixpath
import urlparse
import rclexecm
@ -110,8 +111,8 @@ class ChmWalker(HTMLParser):
HTMLParser.__init__(self)
self.chm = chm
self.contents = contents
self.path = os.path.normpath(path)
self.dir = os.path.dirname(self.path)
self.path = posixpath.normpath(path)
self.dir = posixpath.dirname(self.path)
contents.append(self.path)
def handle_starttag(self, tag, attrs):
@ -139,9 +140,9 @@ class ChmWalker(HTMLParser):
if path:
#print "got path", path, "me", self.path, "dir", self.dir
if path[0] == "/":
npath = os.path.normpath(path)
npath = posixpath.normpath(path)
else:
npath = os.path.normpath(os.path.join(self.dir, path))
npath = posixpath.normpath(posixpath.join(self.dir, path))
if not npath in self.contents:
#print("Going into [%s] paths [%s]\n" %
#(npath,str(self.contents)))