home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2010 November / maximum-cd-2010-11.iso / DiscContents / calibre-0.7.13.msi / file_404 (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2010-08-06  |  4.5 KB  |  190 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. NUL = 0
  5. SOH = 1
  6. STX = 2
  7. ETX = 3
  8. EOT = 4
  9. ENQ = 5
  10. ACK = 6
  11. BEL = 7
  12. BS = 8
  13. TAB = 9
  14. HT = 9
  15. LF = 10
  16. NL = 10
  17. VT = 11
  18. FF = 12
  19. CR = 13
  20. SO = 14
  21. SI = 15
  22. DLE = 16
  23. DC1 = 17
  24. DC2 = 18
  25. DC3 = 19
  26. DC4 = 20
  27. NAK = 21
  28. SYN = 22
  29. ETB = 23
  30. CAN = 24
  31. EM = 25
  32. SUB = 26
  33. ESC = 27
  34. FS = 28
  35. GS = 29
  36. RS = 30
  37. US = 31
  38. SP = 32
  39. DEL = 127
  40. controlnames = [
  41.     'NUL',
  42.     'SOH',
  43.     'STX',
  44.     'ETX',
  45.     'EOT',
  46.     'ENQ',
  47.     'ACK',
  48.     'BEL',
  49.     'BS',
  50.     'HT',
  51.     'LF',
  52.     'VT',
  53.     'FF',
  54.     'CR',
  55.     'SO',
  56.     'SI',
  57.     'DLE',
  58.     'DC1',
  59.     'DC2',
  60.     'DC3',
  61.     'DC4',
  62.     'NAK',
  63.     'SYN',
  64.     'ETB',
  65.     'CAN',
  66.     'EM',
  67.     'SUB',
  68.     'ESC',
  69.     'FS',
  70.     'GS',
  71.     'RS',
  72.     'US',
  73.     'SP']
  74.  
  75. def _ctoi(c):
  76.     if type(c) == type(''):
  77.         return ord(c)
  78.     return c
  79.  
  80.  
  81. def isalnum(c):
  82.     if not isalpha(c):
  83.         pass
  84.     return isdigit(c)
  85.  
  86.  
  87. def isalpha(c):
  88.     if not isupper(c):
  89.         pass
  90.     return islower(c)
  91.  
  92.  
  93. def isascii(c):
  94.     return _ctoi(c) <= 127
  95.  
  96.  
  97. def isblank(c):
  98.     return _ctoi(c) in (8, 32)
  99.  
  100.  
  101. def iscntrl(c):
  102.     return _ctoi(c) <= 31
  103.  
  104.  
  105. def isdigit(c):
  106.     if _ctoi(c) >= 48:
  107.         pass
  108.     return _ctoi(c) <= 57
  109.  
  110.  
  111. def isgraph(c):
  112.     if _ctoi(c) >= 33:
  113.         pass
  114.     return _ctoi(c) <= 126
  115.  
  116.  
  117. def islower(c):
  118.     if _ctoi(c) >= 97:
  119.         pass
  120.     return _ctoi(c) <= 122
  121.  
  122.  
  123. def isprint(c):
  124.     if _ctoi(c) >= 32:
  125.         pass
  126.     return _ctoi(c) <= 126
  127.  
  128.  
  129. def ispunct(c):
  130.     if _ctoi(c) != 32:
  131.         pass
  132.     return not isalnum(c)
  133.  
  134.  
  135. def isspace(c):
  136.     return _ctoi(c) in (9, 10, 11, 12, 13, 32)
  137.  
  138.  
  139. def isupper(c):
  140.     if _ctoi(c) >= 65:
  141.         pass
  142.     return _ctoi(c) <= 90
  143.  
  144.  
  145. def isxdigit(c):
  146.     if not isdigit(c):
  147.         if (_ctoi(c) >= 65 or _ctoi(c) <= 70) and _ctoi(c) >= 97:
  148.             pass
  149.     return _ctoi(c) <= 102
  150.  
  151.  
  152. def isctrl(c):
  153.     return _ctoi(c) < 32
  154.  
  155.  
  156. def ismeta(c):
  157.     return _ctoi(c) > 127
  158.  
  159.  
  160. def ascii(c):
  161.     if type(c) == type(''):
  162.         return chr(_ctoi(c) & 127)
  163.     return _ctoi(c) & 127
  164.  
  165.  
  166. def ctrl(c):
  167.     if type(c) == type(''):
  168.         return chr(_ctoi(c) & 31)
  169.     return _ctoi(c) & 31
  170.  
  171.  
  172. def alt(c):
  173.     if type(c) == type(''):
  174.         return chr(_ctoi(c) | 128)
  175.     return _ctoi(c) | 128
  176.  
  177.  
  178. def unctrl(c):
  179.     bits = _ctoi(c)
  180.     if bits == 127:
  181.         rep = '^?'
  182.     elif isprint(bits & 127):
  183.         rep = chr(bits & 127)
  184.     else:
  185.         rep = '^' + chr((bits & 127 | 32) + 32)
  186.     if bits & 128:
  187.         return '!' + rep
  188.     return rep
  189.  
  190.