home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyc (Python 2.6)
-
- import signal
- import os
- import sys
- import IPython.ipapi as IPython
- import subprocess
- ip = IPython.ipapi.get()
-
- def new_ipsystem_posix(cmd):
- p = subprocess.Popen(cmd, shell = True)
- old_handler = signal.signal(signal.SIGINT, signal.SIG_IGN)
- (pid, status) = os.waitpid(p.pid, 0)
- signal.signal(signal.SIGINT, old_handler)
- if status and ip.options.verbose:
- print '[exit status: %d]' % status
-
-
-
- def new_ipsystem_win32(cmd):
- old_handler = signal.signal(signal.SIGINT, signal.SIG_IGN)
- status = os.system(cmd)
- signal.signal(signal.SIGINT, old_handler)
- if status and ip.options.verbose:
- print '[exit status: %d]' % status
-
-
-
- def init():
- o = ip.options
-
- try:
- o.verbose
- except AttributeError:
- o.allow_new_attr(True)
- o.verbose = 0
-
- if not sys.platform == 'win32' or new_ipsystem_win32:
- pass
- ip.IP.system = new_ipsystem_posix
-
- init()
-