def convertDocTo(self, sourceFilename, destFilename, reindex=False):
     #print "convertDocTo(%s, %s)" % (sourceFilename, destFilename)
     if self.useOoo:  # Use the oooConverter or use cached results of oooConverter
         import ooo_converter
         srcFilename = self.testOdtFile
         self.oooConverter = ooo_converter.oooConverter()
         self.oooConverter.convertDocumentTo(srcFilename, destFilename)
         # Cache the result
         #filename = os.path.split(destFilename)[1]
         filename = fs.split(destFilename)[1]
         #filename = os.path.abspath(self.basePath + filename)
         filename = fs.absPath(self.basePath + filename)
         self.oooConverter.convertDocumentTo(srcFilename, filename)
     else:
         #ext = os.path.splitext(destFilename)[1]
         ext = fs.splitExt(destFilename)[1]
         if ext == ".pdf":
             self.__copy(self.testPdfFile, destFilename)
         elif ext == ".html":
             self.__copy(self.testHtmlFile, destFilename)
             # also copy the associated images
             #toPath = os.path.split(destFilename)[0]
             toPath = fs.split(destFilename)[0]
             #files = [file for file in os.listdir(self.basePath) if file.startswith("temp_html_")]
             files = [
                 file for file in fs.list(self.basePath)
                 if file.startswith("temp_html_")
             ]
             for file in files:
                 self.__copy(self.basePath + file, toPath + "/" + file)
         else:
             raise Exception("Unexcepted convert to document type!")
     result = True
     msg = ""
     return result, msg
 def convertDocumentTo(self, sourceFilename, destFilename):
     #print "convert DocTo(%s, %s)" % (sourceFilename, destFilename)
     if False:    # Use the oooConverter or use cached results of oooConverter
         import ooo_converter
         self.oooConverter = ooo_converter.oooConverter()
         self.oooConverter.convertDocumentTo(sourceFilename, destFilename)
         # Cache the result
         filename = os.path.split(destFilename)[1]
         filename = os.path.abspath("testData/word/" + filename)
         self.oooConverter.convertDocumentTo(sourceFilename, filename)
     else:
         #if sourceFilename!=testOdtFile:
         #    raise Exception("Unexcepted filename!")
         toFilename = os.path.split(destFilename)[1]
         if toFilename=="temp.odt":
             self.__copy(testOdtFile, destFilename)
         elif toFilename=="temp.pdf":
             self.__copy(testPdfFile, destFilename)
         elif toFilename=="temp.html":
             self.__copy(testHtmlFile, destFilename)
             # also copy the associated images
             toPath = os.path.split(destFilename)[0]
             files = [file for file in os.listdir("testData/word") if file.startswith("temp_html_")]
             for file in files:
                 self.__copy("testData/word/" + file, toPath + "/" + file)
         else:
             raise Exception("Unexcepted convert to document type!")
 def convertDocumentTo(self, sourceFilename, destFilename):
     #print "convert DocTo(%s, %s)" % (sourceFilename, destFilename)
     if False:  # Use the oooConverter or use cached results of oooConverter
         import ooo_converter
         self.oooConverter = ooo_converter.oooConverter()
         self.oooConverter.convertDocumentTo(sourceFilename, destFilename)
         # Cache the result
         filename = os.path.split(destFilename)[1]
         filename = os.path.abspath("testData/word/" + filename)
         self.oooConverter.convertDocumentTo(sourceFilename, filename)
     else:
         #if sourceFilename!=testOdtFile:
         #    raise Exception("Unexcepted filename!")
         toFilename = os.path.split(destFilename)[1]
         if toFilename == "temp.odt":
             self.__copy(testOdtFile, destFilename)
         elif toFilename == "temp.pdf":
             self.__copy(testPdfFile, destFilename)
         elif toFilename == "temp.html":
             self.__copy(testHtmlFile, destFilename)
             # also copy the associated images
             toPath = os.path.split(destFilename)[0]
             files = [
                 file for file in os.listdir("testData/word")
                 if file.startswith("temp_html_")
             ]
             for file in files:
                 self.__copy("testData/word/" + file, toPath + "/" + file)
         else:
             raise Exception("Unexcepted convert to document type!")
 def convertDocTo(self, sourceFilename, destFilename, reindex=False):
     #print "convertDocTo(%s, %s)" % (sourceFilename, destFilename)
     if self.useOoo:    # Use the oooConverter or use cached results of oooConverter
         import ooo_converter
         srcFilename = self.testOdtFile
         self.oooConverter = ooo_converter.oooConverter()
         self.oooConverter.convertDocumentTo(srcFilename, destFilename)
         # Cache the result
         #filename = os.path.split(destFilename)[1]
         filename = fs.split(destFilename)[1]
         #filename = os.path.abspath(self.basePath + filename)
         filename = fs.absPath(self.basePath + filename)
         self.oooConverter.convertDocumentTo(srcFilename, filename)
     else:
         #ext = os.path.splitext(destFilename)[1]
         ext = fs.splitExt(destFilename)[1]
         if ext==".pdf":
             self.__copy(self.testPdfFile, destFilename)
         elif ext==".html":
             self.__copy(self.testHtmlFile, destFilename)
             # also copy the associated images
             #toPath = os.path.split(destFilename)[0]
             toPath = fs.split(destFilename)[0]
             #files = [file for file in os.listdir(self.basePath) if file.startswith("temp_html_")]
             files = [file for file in fs.list(self.basePath) if file.startswith("temp_html_")]
             for file in files:
                 self.__copy(self.basePath + file, toPath + "/" + file)
         else:
             raise Exception("Unexcepted convert to document type!")
     result = True
     msg = ""
     return result, msg         
 def convertDocumentTo(self, sourceFilename, destFilename):
     #print "convert DocTo(%s, %s)" % (sourceFilename, destFilename)
     if False:
         import ooo_converter
         self.oooConverter = ooo_converter.oooConverter()
         self.oooConverter.convertDocumentTo(sourceFilename, destFilename)
         filename = os.path.split(destFilename)[1]
         filename = os.path.abspath("testData/master" + filename)
         self.oooConverter.convertDocumentTo(sourceFilename, filename)
     else:
         #if sourceFilename!=testOdmFile:
         #    raise Exception("Unexcepted filename!")
         toFilename = os.path.split(destFilename)[1]
         if toFilename == "temp.pdf":
             self.__copy(testPdfFile, destFilename)
         else:
             raise Exception("Unexcepted convert to document type!")
 def convertDocumentTo(self, sourceFilename, destFilename):
     #print "convert DocTo(%s, %s)" % (sourceFilename, destFilename)
     if False:
         import ooo_converter
         self.oooConverter = ooo_converter.oooConverter()
         self.oooConverter.convertDocumentTo(sourceFilename, destFilename)
         filename = os.path.split(destFilename)[1]
         filename = os.path.abspath("testData/master" + filename)
         self.oooConverter.convertDocumentTo(sourceFilename, filename)
     else:
         #if sourceFilename!=testOdmFile:
         #    raise Exception("Unexcepted filename!")
         toFilename = os.path.split(destFilename)[1]
         if toFilename=="temp.pdf":
             self.__copy(testPdfFile, destFilename)
         else:
             raise Exception("Unexcepted convert to document type!")
def getOOoConverterMethod():
    import relative_linker
    from ooo_converter import oooConverter
    oooConverterMethod = oooConverter().convertDocTo
    return oooConverterMethod
def getOOoConverterMethod():
    import relative_linker
    from ooo_converter import oooConverter
    oooConverterMethod = oooConverter().convertDocTo
    return oooConverterMethod