From 24469afbbe17cb840c301e2ccc9f083d367b3ac8 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sat, 1 May 2010 10:25:55 -0400 Subject: urls, screen info control tuning --- lib/sisu/v2/hub.rb | 7 +- lib/sisu/v2/urls.rb | 180 +++++++++++++++++++++++++++++----------------------- 2 files changed, 104 insertions(+), 83 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v2/hub.rb b/lib/sisu/v2/hub.rb index b54ebc51..36470fd1 100644 --- a/lib/sisu/v2/hub.rb +++ b/lib/sisu/v2/hub.rb @@ -173,8 +173,9 @@ module SiSU end end @n_do=@n_do+1 - tell=SiSU_Screen::Ansi.new(@opt.cmd,@n_do,"#{@req.upcase} processed") - tell.files_processed unless @opt.cmd =~/q/ + unless @opt.cmd =~/q/ + SiSU_Screen::Ansi.new(@opt.cmd,@n_do,"#{@req.upcase} processed").files_processed if @opt.cmd =~/[MVv]/ + end end else Operations.new(@opt).not_found end @@ -489,7 +490,7 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/ end else end - if @opt.cmd =~/[QuUvVM]/; op('urls','urls') #% -Q -u -v -V -M urls + unless @opt.cmd =~/[q]/; op('urls','urls') #% unless -q end @msg,@msgs="\tsisu -W [to start ruby web-server on output directory]\n",nil @tell.call.print_brown if @opt.cmd =~/[uUvVM]/ unless @opt.files.join.empty? diff --git a/lib/sisu/v2/urls.rb b/lib/sisu/v2/urls.rb index a08df9de..6595c139 100644 --- a/lib/sisu/v2/urls.rb +++ b/lib/sisu/v2/urls.rb @@ -124,7 +124,7 @@ module SiSU_urls def songsheet begin urls_all if @opt.cmd=~/U/ - urls_select if @opt.cmd=~/[uvVM]/ + urls_select unless @opt.cmd=~/q/ rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error ensure end @@ -140,8 +140,10 @@ module SiSU_urls if x =~/^m/ \ and @opt.cmd=~/m/ \ and x=~/^[#{opt.cmd}]/ - tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.text_editor} #{@env.path.dal}/#{@opt.fns}.meta") - tell.maintenance unless @opt.cmd =~/q/ + unless @opt.cmd =~/q/ + tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.text_editor} #{@env.path.dal}/#{@opt.fns}.meta") + tell.maintenance if @opt.cmd =~/[MVv]/ + end end if x=~/^([hHw])/ \ and @opt.cmd=~/[hHw]/ \ @@ -155,11 +157,13 @@ module SiSU_urls and x=~/^[#{@opt.cmd}]/ tool=@prog.pdf_viewer fns=@opt.fns.gsub(/~/,'-') - tell=if y =~/landscape/ - SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.text_editor} #{@env.path.tex}/#{fns}.landscape.tex") - else SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.text_editor} #{@env.path.tex}/#{fns}.tex") + unless @opt.cmd =~/q/ + tell=if y =~/landscape/ + SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.text_editor} #{@env.path.tex}/#{fns}.landscape.tex") + else SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.text_editor} #{@env.path.tex}/#{fns}.tex") + end + tell.maintenance if @opt.cmd =~/[MVv]/ end - tell.maintenance unless @opt.cmd =~/q/ end if x=~/^o/ \ and @opt.cmd=~/o/ \ @@ -169,92 +173,106 @@ module SiSU_urls if x=~/^e/ \ and @opt.cmd=~/e/ \ and x=~/^[#{@opt.cmd}]/ - tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.text_editor} #{@env.path.epub}/OPS/toc.xhtml") - tell.maintenance unless @opt.cmd =~/q/ + unless @opt.cmd =~/q/ + tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.text_editor} #{@env.path.epub}/OPS/toc.xhtml") + tell.maintenance if @opt.cmd =~/[MVv]/ + end end if x !~/^[me]/ - tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{tool} #{@env.path.output}/#{@fnb}/#{y}") - tell.maintenance unless @opt.cmd =~/q/ + unless @opt.cmd =~/q/ + tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{tool} #{@env.path.output}/#{@fnb}/#{y}") + tell.maintenance if @opt.cmd =~/[MVv]/ + end end @opt.cmd.gsub!(/#{m}/,'') end end def urls_select - tell=SiSU_Screen::Ansi.new(@opt.cmd,"URLs") - tell.grey_title_hi unless @opt.cmd =~/q/ - tell=SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@env.path.output}/#{@fnb}") - tell.flow unless @opt.cmd =~/q/ + unless @opt.cmd =~/q/ + i="(output manifest) #{@env.url.output_tell}/#{@fnb}/sisu_manifest.html" + @opt.cmd=~/[MVvz]/ \ + ? SiSU_Screen::Ansi.new(@opt.cmd,'URLs').grey_title_hi \ + : SiSU_Screen::Ansi.new(@opt.cmd,'URL',i).green_title_hi + if @opt.cmd =~/[MVv]/; SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@env.path.output}/#{@fnb}").flow + end + end m=/.+\/(?:src\/)?(\S+)/im # m=/.+?\/(?:src\/)?([^\/]+)$/im # m=/.+\/(\S+)/m @pwd_stub="#{@env.url.output_tell}"[m,1] - @u.each do |x,y| - if @opt.fns =~ @m_regular - if x=~/^([abchHNopwxXyY])/ \ - and @opt.cmd=~/[abchHNopwxXyY]/ \ - and x=~/^[#{@opt.cmd}]/ - m=$1 - tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.web_browser} #{@env.url.output_tell}/#{@fnb}/#{y}") - tell.result unless @opt.cmd =~/q/ - @opt.cmd.gsub!(/#{m}/,'') - end - if x=~/^I/ \ - and @opt.cmd =~/I/ - tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","cd #{@env.path.texinfo}; pinfo ./#{@fnb}.#{y}; cd -") - tell.result unless @opt.cmd =~/q/ - @opt.cmd.gsub!(/I/,'') - end - if x=~/^D/ \ - and @opt.cmd =~/D/ - tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x} DBI psql","#{@pwd_stub}::#{@opt.fns}",y) - tell.result unless @opt.cmd =~/q/ - @opt.cmd.gsub!(/D[iu]/,'') - end - if x=~/^d/ \ - and @opt.cmd =~/d/ - tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x} DBI sqlite","sqlite3 #{@env.path.output}/sisu_sqlite.db", "#{y}") - tell.result unless @opt.cmd =~/q/ - @opt.cmd.gsub!(/d[iu]/,'') - end - if x=~/^e/ \ - and @opt.cmd =~/e/ - tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.epub_viewer} #{@env.path.output}/epub/#{y}") - tell.result unless @opt.cmd =~/q/ - end - if x=~/^i/ \ - and @opt.cmd =~/i/ - tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.manpage_generator} #{@env.path.manpage}/#{@fnb}.1 |most") - tell.result unless @opt.cmd =~/q/ - @opt.cmd.gsub!(/I/,'') - end - if x=~/^P/ \ - and @opt.cmd =~/P/ - tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x} Profile","#{@pwd_stub}::#{@opt.fns}",y) - tell.result unless @opt.cmd =~/q/ - @opt.cmd.gsub!(/P/,'') - end - if x=~/^s/ \ - and @opt.cmd =~/s/ - tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.web_browser} #{@env.url.output_tell}/src/#{y}") - tell.result unless @opt.cmd =~/q/ - @opt.cmd.gsub!(/I/,'') - end - if x=~/^S/ \ - and @opt.cmd =~/[sS]/ - zipfile=if @opt.fns =~/\.ssm\.sst$/; y.gsub(/(?:\~\S{2,3})?(\.ssm\.sst\.zip)$/,'.ssm.zip') - else y.gsub(/(?:\~\S{2,3})?(\.sst\.zip)$/,'\1') + unless @opt.cmd =~/q/ + @u.each do |x,y| + if @opt.fns =~ @m_regular + if @opt.cmd =~/[MVv]/ + if x=~/^([abchHNopwxXyY])/ \ + and @opt.cmd=~/[abchHNopwxXyY]/ \ + and x=~/^[#{@opt.cmd}]/ + m=$1 + tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.web_browser} #{@env.url.output_tell}/#{@fnb}/#{y}") + tell.result + @opt.cmd.gsub!(/#{m}/,'') + end + if x=~/^I/ \ + and @opt.cmd =~/I/ + tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","cd #{@env.path.texinfo}; pinfo ./#{@fnb}.#{y}; cd -") + tell.result + @opt.cmd.gsub!(/I/,'') + end + if x=~/^D/ \ + and @opt.cmd =~/D/ + tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x} DBI psql","#{@pwd_stub}::#{@opt.fns}",y) + tell.result + @opt.cmd.gsub!(/D[iu]/,'') + end + if x=~/^d/ \ + and @opt.cmd =~/d/ + tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x} DBI sqlite","sqlite3 #{@env.path.output}/sisu_sqlite.db", "#{y}") + tell.result + @opt.cmd.gsub!(/d[iu]/,'') + end + if x=~/^e/ \ + and @opt.cmd =~/e/ + tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.epub_viewer} #{@env.path.output}/epub/#{y}") + tell.result + end + if x=~/^i/ \ + and @opt.cmd =~/i/ + tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.manpage_generator} #{@env.path.manpage}/#{@fnb}.1 |most") + tell.result + @opt.cmd.gsub!(/I/,'') + end + if x=~/^P/ \ + and @opt.cmd =~/P/ + tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x} Profile","#{@pwd_stub}::#{@opt.fns}",y) + tell.result + @opt.cmd.gsub!(/P/,'') + end + if x=~/^s/ \ + and @opt.cmd =~/s/ + tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.web_browser} #{@env.url.output_tell}/src/#{y}") + tell.result + @opt.cmd.gsub!(/I/,'') + end + if x=~/^S/ \ + and @opt.cmd =~/[sS]/ + zipfile=if @opt.fns =~/\.ssm\.sst$/; y.gsub(/(?:\~\S{2,3})?(\.ssm\.sst\.zip)$/,'.ssm.zip') + else y.gsub(/(?:\~\S{2,3})?(\.sst\.zip)$/,'\1') + end + tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.web_browser} #{@env.url.output_tell}/pod/#{y}") + tell.result + @opt.cmd.gsub!(/I/,'') + end end - tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.web_browser} #{@env.url.output_tell}/pod/#{y}") - tell.result unless @opt.cmd =~/q/ - @opt.cmd.gsub!(/I/,'') + urls_maintenance(@opt,x,y) if @opt.cmd =~/[MV]/ end - urls_maintenance(@opt,x,y) if @opt.cmd =~/[MV]/ end end end def urls_all - tell=SiSU_Screen::Ansi.new(@opt.cmd,'URLs') - tell.grey_title_hi unless @opt.cmd =~/q/ - tell=SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@env.path.output}/#{@fnb}") - tell.flow unless @opt.cmd =~/q/ + unless @opt.cmd =~/q/ + tell=SiSU_Screen::Ansi.new(@opt.cmd,'URLs') + tell.grey_title_hi if @opt.cmd =~/[MVv]/ + tell=SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@env.path.output}/#{@fnb}") + tell.flow if @opt.cmd =~/[MVv]/ + end @u.each do |x,y| tell=case x when /^m/ @@ -271,8 +289,10 @@ module SiSU_urls when /^i/ SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.manpage_generator} #{@env.path.manpage}/#{@fnb}.1 |most") end - tellx.result if tellx - tell.result if tell + unless @opt.cmd =~/q/ + tellx.result if tellx and @opt.cmd =~/[MVv]/ + tell.result if tell and @opt.cmd =~/[MVv]/ + end tellx=nil end end -- cgit v1.2.3