From bdd62aba95cba6aa4930e14cee00d2dcc6d43f96 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 17 May 2011 18:11:15 -0400 Subject: v3: po4a re-enabled, related fixes (issues persist) --- lib/sisu/v3/param.rb | 153 ++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 114 insertions(+), 39 deletions(-) (limited to 'lib/sisu/v3/param.rb') diff --git a/lib/sisu/v3/param.rb b/lib/sisu/v3/param.rb index 87a556ec..5d93523e 100644 --- a/lib/sisu/v3/param.rb +++ b/lib/sisu/v3/param.rb @@ -79,8 +79,9 @@ module SiSU_Param @opt=opt @cX||=SiSU_Screen::Ansi.new(opt.cmd) @cmd,@mod=opt.cmd,opt.mod - unless @opt.cmd =~/P/ - @fns=opt.fns.gsub(/\.ssm$/,'.ssm.sst') #revisit CHECK + @fns=if @opt.cmd =~/P/ #revisit CHECK + opt.fns + else opt.fns.gsub(/\.ssm$/,'.ssm.sst') end Instantiate.new.param_instantiate @env=SiSU_Env::Info_env.new(@fns) @@ -258,12 +259,16 @@ module SiSU_Param validate_length(s,l,n) end def short - s=(@h['short'] ? @h['short'] : @h['main']) + s=@h['short'] \ + ? @h['short'] \ + : @h['main'] l,n=Db[:col_title_part],'title.short' validate_length(s,l,n) end def full - s=(@h['subtitle'] ? (@h['main'] + ' - ' + @h['subtitle']) : @h['main']) + s=@h['subtitle'] \ + ? (@h['main'] + ' - ' + @h['subtitle']) \ + : @h['main'] l,n=Db[:col_title],'title.full' validate_length(s,l,n) end @@ -290,13 +295,19 @@ module SiSU_Param validate_length(s,l,n) end def author_detail - s=(@h['author'] ? @h['author'] : @h['main']) + s=@h['author'] \ + ? @h['author'] \ + : @h['main'] names=name_format(s) names[:name_a_h] end def contributor - names=(@h['contributor'] ? name_format(@h['contributor']) : nil) - s=(names.class==Hash) ? names[:name_str] : nil + names=@h['contributor'] \ + ? name_format(@h['contributor']) \ + : nil + s=(names.class==Hash) \ + ? names[:name_str] \ + : nil s=if s l,n=Db[:col_name],'creator.author' validate_length(s,l,n) @@ -304,12 +315,20 @@ module SiSU_Param end end def contributor_detail - names=(@h['contributor'] ? name_format(@h['contributor']) : nil) - (names.class==Hash) ? names[:name_a_h] : nil + names=@h['contributor'] \ + ? name_format(@h['contributor']) \ + : nil + (names.class==Hash) \ + ? names[:name_a_h] \ + : nil end def illustrator - names=(@h['illustrator'] ? name_format(@h['illustrator']) : nil) - s=(names.class==Hash) ? names[:name_str] : nil + names=@h['illustrator'] \ + ? name_format(@h['illustrator']) \ + : nil + s=(names.class==Hash) \ + ? names[:name_str] \ + : nil s=if s l,n=Db[:col_name],'creator.illustrator' validate_length(s,l,n) @@ -317,12 +336,20 @@ module SiSU_Param end end def illustrator_detail - names=(@h['illustrator'] ? name_format(@h['illustrator']) : nil) - (names.class==Hash) ? names[:name_a_h] : nil + names=@h['illustrator'] \ + ? name_format(@h['illustrator']) \ + : nil + (names.class==Hash) \ + ? names[:name_a_h] \ + : nil end def photographer - names=(@h['photographer'] ? name_format(@h['photographer']) : nil) - s=(names.class==Hash) ? names[:name_str] : nil + names=@h['photographer'] \ + ? name_format(@h['photographer']) \ + : nil + s=(names.class==Hash) \ + ? names[:name_str] \ + : nil s=if s l,n=Db[:col_name],'creator.photographer' validate_length(s,l,n) @@ -330,12 +357,20 @@ module SiSU_Param end end def photographer_detail - names=(@h['photographer'] ? name_format(@h['photographer']) : nil) - (names.class==Hash) ? names[:name_a_h] : nil + names=@h['photographer'] \ + ? name_format(@h['photographer']) \ + : nil + (names.class==Hash) \ + ? names[:name_a_h] \ + : nil end def translator - names=(@h['translator'] ? name_format(@h['translator']) : nil) - s=(names.class==Hash) ? names[:name_str] : nil + names=@h['translator'] \ + ? name_format(@h['translator']) \ + : nil + s=(names.class==Hash) \ + ? names[:name_str] \ + : nil s=if s l,n=Db[:col_name],'creator.translator' validate_length(s,l,n) @@ -343,12 +378,20 @@ module SiSU_Param end end def translator_detail - names=(@h['translator'] ? name_format(@h['translator']) : nil) - (names.class==Hash) ? names[:name_a_h] : nil + names=@h['translator'] \ + ? name_format(@h['translator']) \ + : nil + (names.class==Hash) \ + ? names[:name_a_h] \ + : nil end def audio - names=(@h['audio'] ? name_format(@h['audio']) : nil) - s=(names.class==Hash) ? names[:name_str] : nil + names=@h['audio'] \ + ? name_format(@h['audio']) \ + : nil + s=(names.class==Hash) \ + ? names[:name_str] \ + : nil s=if s l,n=Db[:col_name],'creator.audio' validate_length(s,l,n) @@ -356,12 +399,20 @@ module SiSU_Param end end def audio_detail - names=(@h['audio'] ? name_format(@h['audio']) : nil) - (names.class==Hash) ? names[:name_a_h] : nil + names=@h['audio'] \ + ? name_format(@h['audio']) \ + : nil + (names.class==Hash) \ + ? names[:name_a_h] \ + : nil end def digitized_by - names=(@h['digitized_by'] ? name_format(@h['digitized_by']) : nil) - s=(names.class==Hash) ? names[:name_str] : nil + names=@h['digitized_by'] \ + ? name_format(@h['digitized_by']) \ + : nil + s=(names.class==Hash) \ + ? names[:name_str] \ + : nil s=if s l,n=Db[:col_name],'creator.digitized_by' validate_length(s,l,n) @@ -369,12 +420,20 @@ module SiSU_Param end end def digitized_by_detail - names=(@h['digitized_by'] ? name_format(@h['digitized_by']) : nil) - (names.class==Hash) ? names[:name_a_h] : nil + names=@h['digitized_by'] \ + ? name_format(@h['digitized_by']) \ + : nil + (names.class==Hash) \ + ? names[:name_a_h] \ + : nil end def prepared_by - names=(@h['prepared_by'] ? name_format(@h['prepared_by']) : nil) - s=(names.class==Hash) ? names[:name_str] : nil + names=@h['prepared_by'] \ + ? name_format(@h['prepared_by']) \ + : nil + s=(names.class==Hash) \ + ? names[:name_str] \ + : nil s=if s l,n=Db[:col_name],'creator.prepared_by' validate_length(s,l,n) @@ -382,9 +441,13 @@ module SiSU_Param end end def prepared_by_detail - names=(@h['prepared_by'] ? name_format(@h['prepared_by']) : nil) + names=@h['prepared_by'] \ + ? name_format(@h['prepared_by']) \ + : nil names=name_format(@h['prepared_by']) - (names.class==Hash) ? names[:name_a_h] : nil + (names.class==Hash) \ + ? names[:name_a_h] \ + : nil end self end @@ -407,34 +470,46 @@ module SiSU_Param validate_length(s,l,n) end def translation - s=(@h['translation'] ? @h['translation'] : nil) + s=@h['translation'] \ + ? @h['translation'] \ + : nil l,n=Db[:col_info_note],'rights.copyright.translation' validate_length(s,l,n) end def illustrations - s=(@h['illustrations'] ? @h['illustrations'] : nil) + s=@h['illustrations'] \ + ? @h['illustrations'] \ + : nil l,n=Db[:col_info_note],'rights.copyright.illustrations' validate_length(s,l,n) end def photographs - s=(@h['photographs'] ? @h['photographs'] : nil) + s=@h['photographs'] \ + ? @h['photographs'] \ + : nil l,n=Db[:col_info_note],'rights.copyright.photographs' validate_length(s,l,n) end def digitization - s=(@h['digitization'] ? @h['digitization'] : nil) + s=@h['digitization'] \ + ? @h['digitization'] \ + : nil l,n=Db[:col_info_note],'rights.copyright.digitization' validate_length(s,l,n) end def audio - s=(@h['audio'] ? @h['audio'] : nil) + s=@h['audio'] \ + ? @h['audio'] \ + : nil l,n=Db[:col_info_note],'rights.copyright.audio' validate_length(s,l,n) end self end def license - s=(@h['license'] ? @h['license'] : nil) + s=@h['license'] \ + ? @h['license'] \ + : nil l,n=Db[:col_info_note],'rights.license' validate_length(s,l,n) end -- cgit v1.2.3