objdictgen/doc_index/DS301_index.py
changeset 72 68524f7c58b5
parent 0 4472ee7c6c3e
child 147 de96ec63a793
equal deleted inserted replaced
71:95cd3376cc9f 72:68524f7c58b5
     4 import os
     4 import os
     5 
     5 
     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}
     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}
     7 
     7 
     8 def OpenPDFDocIndex(index):
     8 def OpenPDFDocIndex(index):
     9     if index not in DS301_PDF_INDEX:
       
    10 	    return """No documentation for this index."""
       
    11     if not os.path.isfile("../doc/301_v04000201.pdf"):
     9     if not os.path.isfile("../doc/301_v04000201.pdf"):
    12         return """No documentation file available.
    10         return """No documentation file available.
    13 Please read can festival documentation to know how to obtain one."""
    11 Please read can festival documentation to know how to obtain one."""
    14     try:
    12     try:
    15         os.system("xpdf -remote DS301 ../doc/301_v04000201.pdf "+str(DS301_PDF_INDEX[index])+" &")
    13         if index in DS301_PDF_INDEX:
       
    14             os.system("xpdf -remote DS301 ../doc/301_v04000201.pdf "+str(DS301_PDF_INDEX[index])+" &")
       
    15         else:
       
    16             os.system("xpdf -remote DS301 ../doc/301_v04000201.pdf &")
    16         return True
    17         return True
    17     except:
    18     except:
    18         return """Check if xpdf is correctly installed on your computer"""
    19         return """Check if xpdf is correctly installed on your computer"""
    19 	
    20