aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v5/odf.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v5/odf.rb')
-rw-r--r--lib/sisu/v5/odf.rb33
1 files changed, 21 insertions, 12 deletions
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
<style:style style:name="Table2.N" style:family="table-column"><style:table-column-properties style:column-width="1.214cm" style:rel-column-width="4681*"/></style:style>
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
<text:sequence-decls><text:sequence-decl text:display-outline-level="0" text:name="Illustration"/><text:sequence-decl text:display-outline-level="0" text:name="Table"/><text:sequence-decl text:display-outline-level="0" text:name="Text"/><text:sequence-decl text:display-outline-level="0" text:name="Drawing"/></text:sequence-decls>
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