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

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. import signal
  5. import os
  6. import sys
  7. import IPython.ipapi as IPython
  8. import subprocess
  9. ip = IPython.ipapi.get()
  10.  
  11. def new_ipsystem_posix(cmd):
  12.     p = subprocess.Popen(cmd, shell = True)
  13.     old_handler = signal.signal(signal.SIGINT, signal.SIG_IGN)
  14.     (pid, status) = os.waitpid(p.pid, 0)
  15.     signal.signal(signal.SIGINT, old_handler)
  16.     if status and ip.options.verbose:
  17.         print '[exit status: %d]' % status
  18.     
  19.  
  20.  
  21. def new_ipsystem_win32(cmd):
  22.     old_handler = signal.signal(signal.SIGINT, signal.SIG_IGN)
  23.     status = os.system(cmd)
  24.     signal.signal(signal.SIGINT, old_handler)
  25.     if status and ip.options.verbose:
  26.         print '[exit status: %d]' % status
  27.     
  28.  
  29.  
  30. def init():
  31.     o = ip.options
  32.     
  33.     try:
  34.         o.verbose
  35.     except AttributeError:
  36.         o.allow_new_attr(True)
  37.         o.verbose = 0
  38.  
  39.     if not sys.platform == 'win32' or new_ipsystem_win32:
  40.         pass
  41.     ip.IP.system = new_ipsystem_posix
  42.  
  43. init()
  44.