objdictgen/doc_index/DS301_index.py
author greg
Tue, 15 Jan 2008 10:49:35 +0100
changeset 358 4630ccf4932a
parent 341 7ff01f109bbc
child 386 0f56a144ba5f
permissions -rw-r--r--
add setup.py and objdictedit_postinst.py to build windows installer
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     1
#!/usr/bin/env python
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     2
# -*- coding: utf-8 -*-
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     3
341
7ff01f109bbc Windows related enhancements
etisserant
parents: 158
diff changeset
     4
import os,wx
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     5
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     6
DS301_PDF_INDEX = {0x1000: 86, 0x1001: 87, 0x1002: 87, 0x1003: 88, 0x1005: 89, 0x1006: 90, 0x1007: 90, 0x1008: 91, 0x1009: 91, 0x100A: 91, 0x100C: 92, 0x100D: 92, 0x1010: 92, 0x1011: 94, 0x1012: 97, 0x1013: 98, 0x1014: 98, 0x1015: 99, 0x1016: 100, 0x1017: 101, 0x1018: 101, 0x1020: 117, 0x1200: 103, 0x1201: 103, 0x1280: 105, 0x1400: 106, 0x1600: 109, 0x1800: 111, 0x1A00: 112}
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     7
147
de96ec63a793 Bug on CanOpen help popup corrected
lbessard
parents: 72
diff changeset
     8
def OpenPDFDocIndex(index, cwd):
341
7ff01f109bbc Windows related enhancements
etisserant
parents: 158
diff changeset
     9
    if not os.path.isfile(os.path.join(cwd, "doc","301_v04000201.pdf")):
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    10
        return """No documentation file available.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    11
Please read can festival documentation to know how to obtain one."""
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    12
    try:
72
68524f7c58b5 Code for avoiding possible problem on Window while importing html module
lbessard
parents: 0
diff changeset
    13
        if index in DS301_PDF_INDEX:
341
7ff01f109bbc Windows related enhancements
etisserant
parents: 158
diff changeset
    14
            if wx.Platform == '__WXMSW__':
7ff01f109bbc Windows related enhancements
etisserant
parents: 158
diff changeset
    15
                os.system("Reader %s -n %d &"%(os.path.join(cwd, "doc","301_v04000201.pdf"), DS301_PDF_INDEX[index]))
7ff01f109bbc Windows related enhancements
etisserant
parents: 158
diff changeset
    16
            else:
7ff01f109bbc Windows related enhancements
etisserant
parents: 158
diff changeset
    17
                os.system("xpdf -remote DS301 %s %d &"%(os.path.join(cwd, "doc","301_v04000201.pdf"), DS301_PDF_INDEX[index]))
72
68524f7c58b5 Code for avoiding possible problem on Window while importing html module
lbessard
parents: 0
diff changeset
    18
        else:
341
7ff01f109bbc Windows related enhancements
etisserant
parents: 158
diff changeset
    19
            if wx.Platform == '__WXMSW__':
7ff01f109bbc Windows related enhancements
etisserant
parents: 158
diff changeset
    20
                os.system("Reader %s &"%os.path.join(cwd, "doc","301_v04000201.pdf"))
7ff01f109bbc Windows related enhancements
etisserant
parents: 158
diff changeset
    21
            else:
7ff01f109bbc Windows related enhancements
etisserant
parents: 158
diff changeset
    22
                os.system("xpdf -remote DS301 %s &"%os.path.join(cwd, "doc","301_v04000201.pdf"))
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    23
        return True
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    24
    except:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    25
        return """Check if xpdf is correctly installed on your computer"""
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    26