Arrange so we can now open the parent of a document (e.g. chm file instead of temp copy of html page inside chm), even when the parent is itself embedded in an archive
This commit is contained in:
+11
-4
@@ -190,7 +190,6 @@ class rclCHM:
|
||||
def __init__(self, em):
|
||||
self.contents = []
|
||||
self.chm = chm.CHMFile()
|
||||
self.currentindex = 0
|
||||
self.em = em
|
||||
if rclchm_catenate:
|
||||
self.em.setmimetype("text/plain")
|
||||
@@ -240,7 +239,7 @@ class rclCHM:
|
||||
"""Open the chm file and build the contents list by extracting and
|
||||
parsing the Topics object"""
|
||||
|
||||
self.currentindex = 0
|
||||
self.currentindex = -1
|
||||
self.contents = []
|
||||
|
||||
filename = params["filename:"]
|
||||
@@ -248,8 +247,6 @@ class rclCHM:
|
||||
self.em.rclog("LoadCHM failed")
|
||||
return False
|
||||
|
||||
self.sfn = os.path.basename(filename)
|
||||
|
||||
#self.em.rclog("home [%s] topics [%s] title [%s]" %
|
||||
# (self.chm.home, self.chm.topics, self.chm.title))
|
||||
|
||||
@@ -293,6 +290,16 @@ class rclCHM:
|
||||
else:
|
||||
return (False, "", "", rclexecm.RclExecM.eofnow)
|
||||
|
||||
if self.currentindex == -1:
|
||||
# Return "self" doc
|
||||
self.currentindex = 0
|
||||
self.em.setmimetype('text/plain')
|
||||
if len(self.contents) == 0:
|
||||
eof = rclexecm.RclExecM.eofnext
|
||||
else:
|
||||
eof = rclexecm.RclExecM.noteof
|
||||
return (True, "", "", eof)
|
||||
|
||||
if self.currentindex >= len(self.contents):
|
||||
return (False, "", "", rclexecm.RclExecM.eofnow)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user