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

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. import IPython.ipapi as IPython
  5. ip = IPython.ipapi.get()
  6. import os
  7. import sys
  8. from IPython.genutils import *
  9.  
  10. def magic_rehash(self, parameter_s = ''):
  11.     path = filter(os.path.isdir, os.environ.get('PATH', '').split(os.pathsep))
  12.     alias_table = self.shell.alias_table
  13.     for pdir in path:
  14.         for ff in os.listdir(pdir):
  15.             alias_table[ff] = (0, ff)
  16.         
  17.     
  18.     self.shell.alias_table_validate()
  19.     self.shell.init_auto_alias()
  20.  
  21. ip.expose_magic('rehash', magic_rehash)
  22.  
  23. def magic_Quit(self, parameter_s = ''):
  24.     self.shell.ask_exit()
  25.  
  26. ip.expose_magic('Quit', magic_Quit)
  27.  
  28. def magic_p(self, parameter_s = ''):
  29.     exec 'print ' + parameter_s in self.shell.user_ns
  30.  
  31. ip.expose_magic('p', magic_p)
  32.