home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2011 January / maximum-cd-2011-01.iso / DiscContents / calibre-0.7.26.msi / file_1967 (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2010-10-31  |  1.4 KB  |  33 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. import IPython.ipapi as IPython
  5. from IPython.genutils import Term
  6. from IPython.ipapi import IPyAutocall
  7.  
  8. class Macro(IPyAutocall):
  9.     
  10.     def __init__(self, data):
  11.         self.value = ''.join(data).rstrip() + '\n'
  12.  
  13.     
  14.     def __str__(self):
  15.         return self.value
  16.  
  17.     
  18.     def __repr__(self):
  19.         return 'IPython.macro.Macro(%s)' % repr(self.value)
  20.  
  21.     
  22.     def __call__(self, *args):
  23.         Term.cout.flush()
  24.         self._ip.user_ns['_margv'] = args
  25.         self._ip.runlines(self.value)
  26.  
  27.     
  28.     def __getstate__(self):
  29.         return {
  30.             'value': self.value }
  31.  
  32.  
  33.