home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyc (Python 2.6)
-
- import os
- import IPython.ipapi as IPython
- import rpdb2
- ip = IPython.ipapi.get()
- rpdb_started = False
-
- def wdb_f(self, arg):
- global rpdb_started
- if not arg.strip():
- print __doc__
- return None
- if arg.strip() == 'pass':
- passwd = raw_input('Enter new winpdb session password: ')
- ip.db['winpdb_pass'] = passwd
- print 'Winpdb password changed'
- if rpdb_started:
- print 'You need to restart IPython to use the new password'
-
- return None
- path = os.path.abspath(arg)
- if not os.path.isfile(path):
- raise IPython.ipapi.UsageError('%%wdb: file %s does not exist' % path)
- os.path.isfile(path)
- rpdb2.set_temp_breakpoint(path)
- print 'It is time to attach with WinPdb (launch WinPdb if needed, File -> Attach)'
- ip.magic('%run ' + arg)
-
- ip.expose_magic('wdb', wdb_f)
-