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

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. __all__ = [
  5.     'Gnuplot',
  6.     'gp',
  7.     'gp_new',
  8.     'Data',
  9.     'File',
  10.     'Func',
  11.     'GridData',
  12.     'pm3d_config',
  13.     'eps_fix_bbox']
  14. import os
  15. import tempfile
  16. import sys
  17. from IPython.genutils import getoutput
  18. tmpname = tempfile.mktemp()
  19. open(tmpname, 'w').write('set mouse')
  20. gnu_out = getoutput('gnuplot ' + tmpname)
  21. os.unlink(tmpname)
  22. if gnu_out:
  23.     print '*** Your version of Gnuplot appears not to have mouse support.'
  24.     gnuplot_mouse = 0
  25. else:
  26.     gnuplot_mouse = 1
  27. del tmpname
  28. del gnu_out
  29. if os.name in ('nt', 'dos') or sys.platform == 'cygwin':
  30.     gnuplot_persist = 0
  31. else:
  32.     gnuplot_persist = 1
  33. import IPython.Gnuplot2 as Gnuplot
  34.  
  35. class NotGiven:
  36.     pass
  37.  
  38.  
  39. def gp_new(mouse = NotGiven, persist = NotGiven):
  40.     if mouse is NotGiven:
  41.         mouse = gnuplot_mouse
  42.     
  43.     if persist is NotGiven:
  44.         persist = gnuplot_persist
  45.     
  46.     g = Gnuplot.Gnuplot(persist = persist)
  47.     if mouse:
  48.         g('set mouse')
  49.     
  50.     return g
  51.  
  52. gp = gp_new()
  53. Data = Gnuplot.Data
  54. File = Gnuplot.File
  55. Func = Gnuplot.Func
  56. String = Gnuplot.String
  57. GridData = Gnuplot.GridData
  58. eps_fix_bbox = Gnuplot.eps_fix_bbox
  59. pm3d_config = '\nset pm3d solid\nset hidden3d\nunset surface\nset isosamples 50\n'
  60.