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

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. import sys
  5.  
  6. try:
  7.     from readline import *
  8.     import readline as _rl
  9.     have_readline = True
  10. except ImportError:
  11.     
  12.     try:
  13.         from pyreadline import *
  14.         import pyreadline as _rl
  15.         have_readline = True
  16.     except ImportError:
  17.         have_readline = False
  18.     except:
  19.         None<EXCEPTION MATCH>ImportError
  20.     
  21.  
  22.     None<EXCEPTION MATCH>ImportError
  23.  
  24. if sys.platform == 'win32' and have_readline:
  25.     
  26.     try:
  27.         _outputfile = _rl.GetOutputFile()
  28.     except AttributeError:
  29.         print 'Failed GetOutputFile'
  30.         have_readline = False
  31.     except:
  32.         None<EXCEPTION MATCH>AttributeError
  33.     
  34.  
  35. None<EXCEPTION MATCH>AttributeError
  36. uses_libedit = False
  37. if sys.platform == 'darwin' and have_readline:
  38.     import commands
  39.     (status, result) = commands.getstatusoutput('otool -L %s | grep libedit' % _rl.__file__)
  40.     if status == 0 and len(result) > 0:
  41.         _rl.parse_and_bind('bind ^I rl_complete')
  42.         print 'Leopard libedit detected.'
  43.         uses_libedit = True
  44.     
  45.  
  46. if have_readline:
  47.     
  48.     try:
  49.         _rl.clear_history
  50.     except AttributeError:
  51.         
  52.         def clear_history():
  53.             pass
  54.  
  55.         _rl.clear_history = clear_history
  56.     except:
  57.         None<EXCEPTION MATCH>AttributeError
  58.     
  59.  
  60. None<EXCEPTION MATCH>AttributeError
  61.