a/src/filters/rclepub b/src/filters/rclepub
...
...
46
            self.em.rclog("extractone: failed: [%s]" % err)
46
            self.em.rclog("extractone: failed: [%s]" % err)
47
            return (False, "", id, iseof)
47
            return (False, "", id, iseof)
48
48
49
    def openfile(self, params):
49
    def openfile(self, params):
50
        """Open the EPUB file, create a contents array"""
50
        """Open the EPUB file, create a contents array"""
51
        self.currentindex = 0
51
        self.currentindex = -1
52
        self.contents = []
52
        self.contents = []
53
        try:
53
        try:
54
            self.book = epub.open(params["filename:"])
54
            self.book = epub.open(params["filename:"])
55
        except Exception, err:
55
        except Exception, err:
56
            self.em.rclog("openfile: epub.open failed: [%s]" % err)
56
            self.em.rclog("openfile: epub.open failed: [%s]" % err)
...
...
63
63
64
    def getipath(self, params):
64
    def getipath(self, params):
65
        return self.extractone(params["ipath:"])
65
        return self.extractone(params["ipath:"])
66
        
66
        
67
    def getnext(self, params):
67
    def getnext(self, params):
68
69
        if self.currentindex == -1:
70
            # Return "self" doc
71
            self.currentindex = 0
72
            self.em.setmimetype('text/plain')
73
            if len(self.contents) == 0:
74
                eof = rclexecm.RclExecM.eofnext
75
            else:
76
                eof = rclexecm.RclExecM.noteof
77
            return (True, "", "", eof)
78
68
        if self.currentindex >= len(self.contents):
79
        if self.currentindex >= len(self.contents):
69
            return (False, "", "", rclexecm.RclExecM.eofnow)
80
            return (False, "", "", rclexecm.RclExecM.eofnow)
70
        else:
81
        else:
71
            ret= self.extractone(self.contents[self.currentindex])
82
            ret= self.extractone(self.contents[self.currentindex])
72
            self.currentindex += 1
83
            self.currentindex += 1