fix regarding dirnames in Feature #110

This commit is contained in:
Miroslav Stampar 2010-01-04 12:39:07 +00:00
parent 2eb24c6368
commit d71e47ce56

View File

@ -27,6 +27,8 @@ import os
import re import re
import StringIO import StringIO
import zlib import zlib
import ntpath
import posixpath
from lib.core.data import conf from lib.core.data import conf
from lib.core.data import kb from lib.core.data import kb
@ -77,7 +79,11 @@ def parseResponse(page, headers):
absFilePath = match.group("result") absFilePath = match.group("result")
if absFilePath not in kb.absFilePaths: if absFilePath not in kb.absFilePaths:
kb.absFilePaths.add(os.path.dirname(absFilePath)) if absFilePath.find('/') != -1:
dirname = posixpath.dirname(absFilePath)
else:
dirname = ntpath.dirname(absFilePath)
kb.absFilePaths.add(dirname)
def decodePage(page, encoding): def decodePage(page, encoding):
""" """