def printout
if Readline.respond_to?('input')
Readline.input = open(DEVTTY)
else
STDIN.reopen DEVTTY unless STDIN.tty?
end
loop do
selection,booklet,twosided,lpropt,output = ask_selection(@batch)
selection == 'quit' and quit
selection == 'continue' and next
selection = '-' if selection.empty?
if output
output.sub!(/.*\//,'')
output = File.join(ENV['VPPOUTDIR'] || WORKDIR,output)
end
if @doublesided
doselection(selection,booklet, nil ,lpropt,output)
else
if booklet
doselection(selection,true, 'odd' ,lpropt,output)
wait_for_printer unless output
doselection(selection,true, 'even',lpropt,output)
elsif twosided
doselection(selection,false,'odd' ,lpropt,output)
wait_for_printer unless output
doselection(selection,false,'even',lpropt,output)
else
doselection(selection,false, nil ,lpropt,output)
end
end
break if @batch
end
end