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

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. import os
  5. import sys
  6. import ipy_rehashdir
  7. import glob
  8. from ipy_rehashdir import selflaunch, PyLauncher
  9.  
  10. def pylaunchers():
  11.     fs = glob.glob('*.py') + glob.glob('*.ipy')
  12.     for f in fs:
  13.         l = PyLauncher(f)
  14.         n = os.path.splitext(f)[0]
  15.         ip.defalias(n, l)
  16.         ip.magic('store ' + n)
  17.     
  18.  
  19.  
  20. def exta_imports():
  21.     import distutils.dir_util as distutils
  22.  
  23.  
  24. def kitroot():
  25.     return os.environ.get('IPYKITROOT', None)
  26.  
  27.  
  28. def main():
  29.     if not kitroot():
  30.         print "Can't configure ipykit, IPYKITROOT should be set."
  31.         return None
  32.     os.environ['PATH'] = os.environ['PATH'] + ';' + kitroot() + '\\bin;'
  33.     ip.to_user_ns('pylaunchers')
  34.     cmds = ip.db.get('syscmdlist', None)
  35.     if cmds is None:
  36.         ip.magic('rehashx')
  37.         cmds = ip.db.get('syscmdlist', [])
  38.     
  39.     if 'sc1' in cmds:
  40.         print 'Default editor: Sc1'
  41.         import ipy_editors
  42.         ipy_editors.scite('sc1')
  43.     
  44.     import ipy_fsops
  45.  
  46. greeting = '\n\n === Welcome to ipykit ===\n\n%quickref - learn quickly about IPython.\n\n'
  47.  
  48. def ipython_firstrun(ip):
  49.     print 'First run of ipykit - configuring'
  50.     ip.defalias('py', selflaunch)
  51.     ip.defalias('d', 'dir /w /og /on')
  52.     ip.magic('store py')
  53.     ip.magic('store d')
  54.     bins = kitroot() + '/bin'
  55.     print greeting
  56.  
  57.  
  58. def init_ipython(ipy):
  59.     global ip
  60.     ip = ipy
  61.     main()
  62.  
  63.