Ticket #13807: trac_13807_graphics_filename.patch

File trac_13807_graphics_filename.patch, 2.7 KB (added by jhpalmieri, 9 years ago)
  • sage/matrix/matrix_modn_sparse.pyx

    # HG changeset patch
    # User J. H. Palmieri <palmieri@math.washington.edu>
    # Date 1354945099 28800
    # Node ID b8aa7b74fc102b36ebb47b5a0478126382c998ea
    # Parent  5aa7d85e796e69a83e31d90a821a1ccea5ad44b1
    import graphics_filename from the right place
    
    diff --git a/sage/matrix/matrix_modn_sparse.pyx b/sage/matrix/matrix_modn_sparse.pyx
    a b cimport matrix_dense 
    8585from sage.rings.finite_rings.integer_mod cimport IntegerMod_int, IntegerMod_abstract
    8686
    8787from sage.misc.misc import verbose, get_verbose
    88 from sage.misc.temporary_file import graphics_filename
    8988
    9089import sage.rings.all as rings
    9190
    cdef class Matrix_modn_sparse(matrix_spa 
    585584           direction of the resulting image. If None or a maxsize larger than
    586585           max(self.nrows(),self.ncols()) is given the image will have the
    587586           same pixelsize as the matrix dimensions (default: 512)
     587
     588        EXAMPLES::
     589
     590            sage: M = Matrix(GF(7), [[0,0,0,1,0,0,0,0],[0,1,0,0,0,0,1,0]], sparse=True); M
     591            [0 0 0 1 0 0 0 0]
     592            [0 1 0 0 0 0 1 0]
     593            sage: M.visualize_structure()
    588594        """
    589595        import gd
    590596        import os
    cdef class Matrix_modn_sparse(matrix_spa 
    637643                setPixel( (x,y), colorExact((r-delta,g-delta,b-delta)) )
    638644
    639645        if filename is None:
    640             filename = sage.misc.misc.graphics_filename()
     646            filename = sage.misc.temporary_file.graphics_filename()
     647            if sage.plot.plot.DOCTEST_MODE:
     648                import os
     649                filename = os.path.join(sage.misc.temporary_file.tmp_dir(), filename)
    641650
    642651        im.writePng(filename)
    643652
  • sage/plot/animate.py

    diff --git a/sage/plot/animate.py b/sage/plot/animate.py
    a b www.ffmpeg.org, or use 'convert' to prod 
    378378                raise OSError, msg
    379379        else:
    380380            if not savefile:
    381                 savefile = sage.misc.misc.graphics_filename(ext='gif')
     381                savefile = sage.misc.temporary_file.graphics_filename(ext='gif')
    382382            if not savefile.endswith('.gif'):
    383383                savefile += '.gif'
    384384            savefile = os.path.abspath(savefile)
    please install it and try again.""" 
    554554            if not savefile:
    555555                if output_format is None:
    556556                    output_format = 'mpg'
    557                 savefile = sage.misc.misc.graphics_filename(ext=output_format)
     557                savefile = sage.misc.temporary_file.graphics_filename(ext=output_format)
    558558            else:
    559559                if output_format is None:
    560560                    suffix = os.path.splitext(savefile)[1]