app/controllers/preprocessor/python/python_preprocessor.rb
# Handles the case whn our augmented code has failed syntax validation. Move to the next phase,
# make the original code runnable, and trigger running it.
Handles the case whn our augmented code has failed syntax validation. Move to the next phase,
make the original code runnable, and trigger running it.
Handles the case whn our augmented code has failed syntax validation . Move to the next phase make the original code runnable and trigger running it .
def augment_fail(send, line)
    @phase = :execute
    @code = make_runnable(@code)
    begin
      open("log/simplemode.log", 'a') do |file|
        file.puts '--------------------------------'
        file.puts Time.now
        file.puts '--------------------------------'
        file.puts @augmented_code
        file.puts "\n\n\n"
        @augmented_code = nil
      end
    ensure
      send.call([
        {:write_file => {:filename => @filename, :content => @code}},
        {:execute => {:command => "env PYTHONPATH=$LIB$/python #{VM_PYTHON} -B #{@filename}",
                      :stdout => 'executeoutput',
                      :stderr => 'executeerror'}}])
      return {:type => :warning, :message => 'Start im vereinfachten Modus.'}
    end
  end
def augment_fail ( send , line ) @phase = :execute @code = make_runnable ( @code ) begin open ( "log/simplemode.log" , 'a' ) do | file | file . puts '--------------------------------' file . puts Time . now file . puts '--------------------------------' file . puts @augmented_code file . puts "\n\n\n" @augmented_code = nil end ensure send . call ( [ { :write_file => { :filename => @filename , :content => @code } } , { :execute => { :command => "env PYTHONPATH=$LIB$/python #{VM_PYTHON} -B #{@filename}" , :stdout => 'executeoutput' , :stderr => 'executeerror' } } ] ) return { :type => :warning , :message => 'Start im vereinfachten Modus.' } end end
Handles the case whn our augmented code has failed syntax validation.
Handles the case whn our augmented code has failed syntax validation .
send
line