From edd89902036bde18c91031470e19c871a182cf6d Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 23 Oct 2013 23:40:45 -0400 Subject: v5: options & downstream, more use of opt.act instead of opt.cmd * opt.act.*.set==:on instead of opt.cmd =~/\S/ --- lib/sisu/v5/odf.rb | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) (limited to 'lib/sisu/v5/odf.rb') diff --git a/lib/sisu/v5/odf.rb b/lib/sisu/v5/odf.rb index f52d98e1..ae9a09ec 100644 --- a/lib/sisu/v5/odf.rb +++ b/lib/sisu/v5/odf.rb @@ -82,14 +82,21 @@ module SiSU_ODF def read begin @md,@env,@dal_array=@particulars.md,@particulars.env,@particulars.dal_array - unless @opt.cmd =~/q/ - tool=(@opt.cmd =~/[MVv]/) \ + unless @opt.act[:quiet][:set]==:on + tool=(@opt.act[:verbose][:set]==:on \ + || @opt.act[:verbose_plus][:set]==:on \ + || @opt.act[:maintenance][:set]==:on) \ ? "#{@env.program.odf_viewer} file://#{@md.file.output_path.odt.dir}/#{@md.file.base_filename.odt}" : "[#{@opt.f_pth[:lng_is]}] #{@opt.fno}" - @opt.cmd=~/[MVvz]/ \ - ? SiSU_Screen::Ansi.new(@opt.cmd,'Opendocument (ODF:ODT)',tool).green_hi_blue - : SiSU_Screen::Ansi.new(@opt.cmd,'Opendocument (ODF:ODT)',tool).green_title_hi - SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"file://#{@md.file.output_path.odt.dir}/#{@md.file.base_filename.odt}").flow if @opt.cmd =~/[MV]/ + (@opt.act[:verbose][:set]==:on \ + || @opt.act[:verbose_plus][:set]==:on \ + || @opt.act[:maintenance][:set]==:on) \ + ? SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],'Opendocument (ODF:ODT)',tool).green_hi_blue + : SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],'Opendocument (ODF:ODT)',tool).green_title_hi + if (@opt.act[:verbose_plus][:set]==:on \ + || @opt.act[:maintenance][:set]==:on) + SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],@opt.fns,"file://#{@md.file.output_path.odt.dir}/#{@md.file.base_filename.odt}").flow + end end SiSU_ODF::Source::Scroll.new(@particulars).songsheet rescue @@ -112,7 +119,8 @@ module SiSU_ODF @vz=SiSU_Viz::Defaults.new @tab="\t" @brace_url=SiSU_Viz::Defaults.new.url_decoration - @br=(@md.opt.cmd =~/M/) ? '' : '' + @br=(@md.opt.act[:maintenance][:set]==:on) \ + ? '' : '' #@br=(@md.opt.cmd =~/M/) ? "\n" : '' end def songsheet @@ -121,7 +129,8 @@ module SiSU_ODF @data=markup(@dal_array) publish ensure - unless @md.opt.cmd =~/[MV]/ #check maintenance flag + unless (@md.opt.act[:verbose_plus][:set]==:on \ + || @md.opt.act[:maintenance][:set]==:on) if @env.processing_path.odt =~/od[ft]/ #p "rm -r #{@env.processing_path.odt}" if @md.opt.cmd =~/v/ FileUtils::rm_r(@env.processing_path.odf_pth) @@ -215,7 +224,7 @@ module SiSU_ODF if FileTest.file?("#{img_src}/#{i}") img_src else - SiSU_Screen::Ansi.new(@md.opt.cmd,"ERROR - image:",%{"#{i}" missing},"search locations: #{@env.path.image_source_include_local},#{@env.path.image_source_include_remote} and #{@env.path.image_source_include}").error2 unless @md.opt.cmd =~/q/ + SiSU_Screen::Ansi.new(@md.opt.act[:color_state][:set],"ERROR - image:",%{"#{i}" missing},"search locations: #{@env.path.image_source_include_local},#{@env.path.image_source_include_remote} and #{@env.path.image_source_include}").error2 unless @md.opt.act[:quiet][:set]==:on nil end elsif @md.fns =~/\.ss[tm]$/ \ @@ -228,7 +237,7 @@ module SiSU_ODF and FileTest.file?("#{@env.path.image_source_include_remote}/#{i}") @env.path.image_source_include_remote else - SiSU_Screen::Ansi.new(@md.opt.cmd,"ERROR - image:",%{"#{i}" missing},"search locations: #{@env.path.image_source_include_local},#{@env.path.image_source_include_remote} and #{@env.path.image_source_include}").error2 unless @md.opt.cmd =~/q/ + SiSU_Screen::Ansi.new(@md.opt.act[:color_state][:set],"ERROR - image:",%{"#{i}" missing},"search locations: #{@env.path.image_source_include_local},#{@env.path.image_source_include_remote} and #{@env.path.image_source_include}").error2 unless @md.opt.act[:quiet][:set]==:on nil end end @@ -712,7 +721,7 @@ module SiSU_ODF WOK x=x.strip - x=x.gsub(/\n+/m,'') unless @md.opt.cmd=~/M/ + x=x.gsub(/\n+/m,'') unless @md.opt.act[:maintenance][:set]==:on x else '' end @@ -730,7 +739,7 @@ WOK WOK x=x.strip - x=x.gsub(/\n+/m,'') unless @md.opt.cmd=~/M/ + x=x.gsub(/\n+/m,'') unless @md.opt.act[:maintenance][:set]==:on @@odf[:head] << x end def publish -- cgit v1.2.3