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/sst_to_s_xml_sax.rb | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'lib/sisu/v5/sst_to_s_xml_sax.rb') diff --git a/lib/sisu/v5/sst_to_s_xml_sax.rb b/lib/sisu/v5/sst_to_s_xml_sax.rb index e40e21d4..d6767595 100644 --- a/lib/sisu/v5/sst_to_s_xml_sax.rb +++ b/lib/sisu/v5/sst_to_s_xml_sax.rb @@ -88,8 +88,11 @@ module SiSU_SimpleXML_ModelSax begin @md=@particulars.md #bug, relies on info persistence, assumes -m has previously been run @env=@particulars.env - SiSU_Screen::Ansi.new(@opt.cmd,'invert','XML SAX',"#{@md.fns} -> #{@md.fn[:sxs]}").colorize unless @opt.cmd =~/q/ - SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{Dir.pwd}/#{@md.fn[:sxs]}").flow if @opt.cmd =~/[MV]/ + SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],'invert','XML SAX',"#{@md.fns} -> #{@md.fn[:sxs]}").colorize unless @opt.act[:quiet][:set]==:on + if (@opt.act[:verbose_plus][:set]==:on \ + || @opt.act[:maintenance][:set]==:on) + SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],@opt.fns,"#{Dir.pwd}/#{@md.fn[:sxs]}").flow + end unless @@fns==@opt.fns @@fns=@opt.fns @@fns_array=[] @@ -120,8 +123,12 @@ module SiSU_SimpleXML_ModelSax def songsheet begin SiSU_SimpleXML_ModelSax::Convert::Scroll.new(@data,@particulars).songsheet - SiSU_SimpleXML_ModelSax::Convert::Tidy.new(@md,@env).xml if @md.opt.cmd =~/[vVM]/ # test wellformedness, comment out when not in use - SiSU_Rexml::Rexml.new(@md,@md.fn[:sxs]).xml if @md.opt.cmd =~/M/ # test rexml parsing, comment out when not in use #debug + if (@md.opt.act[:verbose][:set]==:on \ + || @md.opt.act[:verbose_plus][:set]==:on \ + || @md.opt.act[:maintenance][:set]==:on) + SiSU_SimpleXML_ModelSax::Convert::Tidy.new(@md,@env).xml # test wellformedness, comment out when not in use + end + SiSU_Rexml::Rexml.new(@md,@md.fn[:sxs]).xml if @md.opt.act[:maintenance][:set]==:on # test rexml parsing, comment out when not in use #debug rescue SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do __LINE__.to_s + ':' + __FILE__ @@ -435,14 +442,15 @@ WOK end def xml if @prog.tidy !=false #note values can be other than true - if @md.opt.cmd =~/[VM]/ - SiSU_Screen::Ansi.new(@md.opt.cmd,'invert','Using XML Tidy','check document structure').colorize unless @md.opt.cmd =~/q/ - SiSU_Screen::Ansi.new(@md.opt.cmd,'','','check document structure') - tell.grey_open unless @md.opt.cmd =~/q/ + if (@md.opt.act[:verbose_plus][:set]==:on \ + || @md.opt.act[:maintenance][:set]==:on) + SiSU_Screen::Ansi.new(@md.opt.act[:color_state][:set],'invert','Using XML Tidy','check document structure').colorize unless @md.opt.act[:quiet][:set]==:on + SiSU_Screen::Ansi.new(@md.opt.act[:color_state][:set],'','','check document structure') + tell.grey_open unless @md.opt.act[:quiet][:set]==:on tidyfile='/dev/null' #don't want one or screen output, check for alternative flags tidy =SiSU_Env::SystemCall.new("#{Dir.pwd}/#{@md.fn[:sxs]}",tidyfile) tidy.well_formed? - tell.p_off unless @md.opt.cmd =~/q/ + tell.p_off unless @md.opt.act[:quiet][:set]==:on end end end -- cgit v1.2.3