tfix paths in paraview and imagemagick-related scripts - Granular.jl - Julia package for granular dynamics simulation
 (HTM) git clone git://src.adamsgaard.dk/Granular.jl
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 1d013a32cf62e62e9e244a426c3e74894841febd
 (DIR) parent be8afb80350f1c58198b1904265e1d0f022fdc14
 (HTM) Author: Anders Damsgaard <andersd@riseup.net>
       Date:   Wed,  1 Nov 2017 11:17:02 -0400
       
       fix paths in paraview and imagemagick-related scripts
       
       Diffstat:
         M src/io.jl                           |      13 ++++++-------
         M test/vtk.jl                         |       8 ++------
       
       2 files changed, 8 insertions(+), 13 deletions(-)
       ---
 (DIR) diff --git a/src/io.jl b/src/io.jl
       t@@ -886,7 +886,7 @@ renderView1.InteractionMode = '2D'
        """)
                if save_animation
                    write(f, """
       -SaveAnimation('./$(simulation.id).avi', renderView1,
       +SaveAnimation('$(folder)/$(simulation.id).avi', renderView1,
        ImageResolution=[$(width), $(height)],
        FrameRate=$(framerate),
        FrameWindow=[0, $(simulation.file_number)])
       t@@ -895,7 +895,7 @@ FrameWindow=[0, $(simulation.file_number)])
        
                if save_images
                    write(f, """
       -SaveAnimation('./$(simulation.id).png', renderView1,
       +SaveAnimation('$(folder)/$(simulation.id).png', renderView1,
        ImageResolution=[$(width), $(height)],
        FrameRate=$(framerate),
        FrameWindow=[0, $(simulation.file_number)])
       t@@ -929,21 +929,20 @@ function render(simulation::Simulation; pvpython::String="pvpython",
            writeParaviewPythonScript(simulation, save_animation=animation,
                                      save_images=images, verbose=false)
            try
       -        cd(simulation.id)
       -        run(`$(pvpython) $(simulation.id).py`)
       +        run(`$(pvpython) $(simulation.id)/$(simulation.id).py`)
        
                # if available, use imagemagick to create gif from images
                if images
                    try
                        run(`convert -trim +repage -delay 10 -transparent-color white 
       -                    -loop 0 $(simulation.id)*.png $(simulation.id).gif`)
       +                    -loop 0 $(simulation.id)/$(simulation.id)'*'.png 
       +                    $(simulation.id)/$(simulation.id).gif`)
                    catch return_signal
                        if isa(return_signal, Base.UVError)
       -                    error("skipping gif merge since `convert` was not found.")
       +                    info("Skipping gif merge since `convert` was not found.")
                        end
                    end
                end
       -        cd("..")
            catch return_signal
                if isa(return_signal, Base.UVError)
                    error("`pvpython` was not found.")
 (DIR) diff --git a/test/vtk.jl b/test/vtk.jl
       t@@ -68,9 +68,7 @@ SeaIce.writeParaviewPythonScript(sim,
        
        info("Testing Paraview rendering if `pvpython` is present")
        try
       -    cd(sim.id)
       -    run(`pvpython $(sim.id).py`)
       -    cd("..")
       +    run(`pvpython $(sim.id)/$(sim.id).py`)
        catch return_signal
            if !isa(return_signal, Base.UVError)
                @test isfile("$(sim.id)/$(sim.id).avi")
       t@@ -81,9 +79,7 @@ SeaIce.writeParaviewPythonScript(sim,
                                         save_animation=false,
                                         save_images=true)
        try
       -    cd(sim.id)
       -    run(`pvpython $(sim.id).py`)
       -    cd("..")
       +    run(`pvpython $(sim.id)/$(sim.id).py`)
        catch return_signal
            if !isa(return_signal, Base.UVError)
                @test isfile("$(sim.id)/$(sim.id).0000.png")