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

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. import os
  5. import IPython.ipapi as IPython
  6. import rpdb2
  7. ip = IPython.ipapi.get()
  8. rpdb_started = False
  9.  
  10. def wdb_f(self, arg):
  11.     global rpdb_started
  12.     if not arg.strip():
  13.         print __doc__
  14.         return None
  15.     if arg.strip() == 'pass':
  16.         passwd = raw_input('Enter new winpdb session password: ')
  17.         ip.db['winpdb_pass'] = passwd
  18.         print 'Winpdb password changed'
  19.         if rpdb_started:
  20.             print 'You need to restart IPython to use the new password'
  21.         
  22.         return None
  23.     path = os.path.abspath(arg)
  24.     if not os.path.isfile(path):
  25.         raise IPython.ipapi.UsageError('%%wdb: file %s does not exist' % path)
  26.     os.path.isfile(path)
  27.     rpdb2.set_temp_breakpoint(path)
  28.     print 'It is time to attach with WinPdb (launch WinPdb if needed, File -> Attach)'
  29.     ip.magic('%run ' + arg)
  30.  
  31. ip.expose_magic('wdb', wdb_f)
  32.