Ticket #715 (new defect)

Opened 14 years ago

Last modified 14 years ago

Integrate Windows modifications

Reported by: fguillaume Owned by: trac
Priority: P2 Milestone: CPS 3.5.7
Component: PortalTransforms Version: unspecified
Severity: normal Keywords:
Cc:

Description

Some modifications for windows are listed at  http://www.cps-project.org/sections/documentation/users/recherche_full_texte_ss2171 . We must integrate them somehow.

Here they are for reference:

ppt_to_html.py

    #Modify by MPN 2005-5-31
    #binaryName = "ppthtml"
    binaryName = "C:\\CPS3.2.4-1_Pluggins\\xlhtml\\xlHtml-Win32-040\\ppthtml.exe"


xls_to_html.py

    #Modify by MPN 2005-5-31
    #binaryName = "xlhtml"
    binaryName = "C:\\CPS3.2.4-1_Pluggins\\xlhtml\\xlHtml-Win32-040\\xlhtml.exe"

pdf_to_html.py

    #Modify by MPN 2005-5-31
    #binaryName = "pdftohtml"
    binaryName = "C:\\CPS3.2.4-1_Pluggins\\pdftohtml\\pdftohtml-0.36-win32\\pdftohtml-0.36pdftohtml\\pdftohtml.exe"
  

pdf_to_text.py

    #Modify by MPN 2005-5-31
    #binaryName = "pdftotext"
    binaryName = "C:\\CPS3.2.4-1_Pluggins\\Xpdf\\xpdf-3.00pl3-win32\\pdftotext.exe"


ppt_to_html.py

    def invokeCommand(self, tmpdir, fullname):
        # FIXME: windows users...
        # FIXME: character encoding
        # Modify by MPN 2005-5-31
        #basename = sansext(fullname)
        #cmd = 'cd "%s" && %s %s "%s" 1> "%s.html" 2>error_log' % (
        #    tmpdir, self.binary, self.binaryArgs, fullname, basename)
        #os.system(cmd)
        #try:
        #    htmlfile = open("%s/%s.html" % (tmpdir, basename), 'r')
        #    html = htmlfile.read()
        #    htmlfile.close()
        #    # Remove filename inserted by ppthtml
        #    html = re.sub("<TITLE>(.*?)</TITLE>", "", html)
        # XXX: qualify this except !
        #except:
        #    try:
        #        return open("%s/error_log" % tmpdir, 'r').read()
        #    except:
        #        return ''
        #return html
        basename = sansext(fullname)
        cmd = '%s %s %s' % (self.binary, self.binaryArgs, fullname, basename)
        os.system(cmd)
        try:
            html = open(basename).read()
            htmlfile.close()
            # Remove filename inserted by ppthtml
            html = re.sub("<TITLE>(.*?)</TITLE>", "", html)
        # XXX: qualify this except !
        except:
            try:
                return open("%s\\error_log" % tmpdir, 'r').read()
            except:
                return ''
        return html


xls_to_html.py

     def invokeCommand(self, tmpdir, fullname):
        # Modify by MPN 2005-5-31
        # FIXME: windows users...
        #basename = sansext(fullname)
        #cmd = 'cd "%s" && %s %s "%s" 1> "%s.html" 2>error_log' % (
        #    tmpdir, self.binary, self.binaryArgs, fullname, basename)
        #system(cmd)
        #try:
        #    htmlfile = open("%s/%s.html" % (tmpdir, basename), 'r')
        #    html = htmlfile.read()
        #    htmlfile.close()
        #except:
        #    try:
        #        return open("%s/error_log" % tmpdir, 'r').read()
        #    except:
        #        return ''
        #return html
        basename = sansext(fullname)
        cmd = '%s %s %s' % (self.binary, self.binaryArgs, fullname, basename)
        system(cmd)
        try:
            html = open(basename).read()
            html.close()
        except:
            try:
                return open("%s\\error_log" % tmpdir, 'r').read()
            except:
                return ''
        return html

pdf_to_html.py

    def invokeCommand(self, tmpdir, fullname):
        # FIXME: windows users...
    # Adapatation à Windows by CGD 2005-5-31
        #cmd = 'cd "%s" && %s %s "%s" 2>error_log 1>/dev/null' % (
        #    tmpdir, self.binary, self.binaryArgs, fullname)
        #system(cmd)
        #try:
        #    htmlfile = open("%s/%s.html" % (tmpdir, sansext(fullname)), 'r')
        #    html = htmlfile.read()
        #    htmlfile.close()
        #except:
        #    try:
        #        return open("%s/error_log" % tmpdir, 'r').read()
        #    except:
        #        return ''
        #return html
        cmd = '%s %s %s' % (self.binary, self.binaryArgs, fullname)
        system(cmd)
        try:
            htmlfile = "%s\\%s.html" % (tmpdir, sansext(fullname))
            html = open(htmlfile).read()
            htmlfile.close()
        except:
            try:
                return open("%s\\error_log" % tmpdir, 'r').read()
            except:
                return ''
        return html


pdf_to_text.py

    def invokeCommand(self, tmpdir, fullname):
        # FIXME: windows users...
        # Adapatation à Windows by MPN 2005-5-31
        #textfile = "%s/%s.txt" % (tmpdir, sansext(fullname))
        #cmd = 'cd "%s" && %s "%s" "%s" 2>error_log 1>/dev/null' % (
        #    tmpdir, self.binary, fullname, textfile)
        #system(cmd)
        #try:
        #    text = open(textfile).read()
        #except:
        #    try:
        #        return open("%s/error_log" % tmpdir, 'r').read()
        #    except:
        #        return ''
        #return text
        textfile = "%s\\%s.txt" % (tmpdir, sansext(fullname))
        cmd = '%s %s %s' % (self.binary, fullname, textfile)
        system(cmd)
        try:
            text = open(textfile).read()
        except:
            try:
                return open("%s\\error_log" % tmpdir, 'r').read()
            except:
                return ''
        return text


Change History

comment:1 Changed 14 years ago by fguillaume

  • Milestone changed from unspecified to CPS 3.5.0

We really need a dedicated windows maintainer.

Note: See TracTickets for help on using tickets.