d: po4a_shelf, shelf current po4a, change tack
authorRalph Amissah <ralph@amissah.com>
Fri, 16 Jan 2015 03:32:08 +0000 (22:32 -0500)
committerRalph Amissah <ralph@amissah.com>
Tue, 20 Jan 2015 04:46:16 +0000 (23:46 -0500)
data/doc/sisu/CHANGELOG_v6
lib/sisu/develop/hub_actions.rb
lib/sisu/develop/hub_options.rb
lib/sisu/develop/src_po4a_shelf.rb [moved from lib/sisu/develop/po4a.rb with 99% similarity]
lib/sisu/develop/src_po4a_shelf_set.rb [moved from lib/sisu/develop/po4a_set.rb with 99% similarity]

index 22b0ad9cbf059d82eeb11a14f47016e1c971b42c..06773a97c4bd8cc6f1ecb08552b70e0cdd50ea11 100644 (file)
@@ -91,6 +91,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_6.4.0.orig.tar.xz
   * po4a, reinstate possibility to initialize po4a management of translated
     marked up documents, i.e. to place translated versions of a sisu document
     under po4a management (provide po4a.cfg file)
+    NOTE: shelf, abandon, change tack (for now at least)
+    explore a different way
 
   * utils_composite, composite documents (.ssm) extract the list of insert files
 
index 68f0aef9b4d72488fee4b0b331741177feef95cd..44834cbae22470904290c3d99543115b52225e4e 100644 (file)
@@ -707,18 +707,18 @@ module SiSU_Hub_Actions
               end
             end
           end
-          if @opt.act[:po4a][:set]==:on                  #% --po4a, -P
+          if @opt.act[:po4a_shelf][:set]==:on            #% --po4a-shelf
             if @opt.f_pths.length > 0
-              require_relative 'po4a'
+              require_relative 'src_po4a_shelf'
               begin
                 SiSU_Hub_Loops::OptionLoopFiles.new(@opt).
                 loop_files_on_given_option do
-                  SiSU_Po4a::Source.new(@opt).read       # po4a.rb
+                  SiSU_Po4a::Source.new(@opt).read       # src_po4a_shelf.rb
                 end
               ensure
               end
             else
-              msg='po4a request requires sisu markup files'
+              msg='src_po4a_shelf request requires sisu markup files'
               if (@opt.act[:verbose_plus][:set]==:on \
               || @opt.act[:maintenance][:set]==:on)
                 SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:cyan).
index 1ea96af8cc5c4411ce0b4783c0fe3b71d3afec8e..c3f31a88af69954b103df2c2f61a38094d2c94b9 100644 (file)
@@ -614,7 +614,7 @@ module SiSU_Commandline
           if ch =~/N/ then select_arr << '--digests'
             ch=ch.gsub(/[N]/,'')
           end
-          if ch =~/P/ then select_arr << '--po4a'
+          if ch =~/P/ then select_arr << '--po4a-shelf'
             ch=ch.gsub(/[P]/,'')
           end
           if ch =~/d/ then select_arr << '--sqlite'
@@ -1301,8 +1301,11 @@ module SiSU_Commandline
         =~/"--harvest"/) \
         ? { bool: true, set: :on }
         : { bool: false, set: :na }
-        act[:po4a]=if (select_arr.inspect \
-        =~/"--po4a"|"--pot?"/)
+        act[:po4a_shelf]=(select_arr.inspect \
+        =~/"--po4a-shelf"|"--pot?-shelf"/) \
+        ? { bool: true, set: :on }
+        : { bool: false, set: :na }
+        if act[:po4a_shelf][:set]==:on
           act[:po4a_lang_trans]=if select_arr.inspect \
           =~/"--trans-([a-z]{2}):((?:(?:[a-z]{2}\b),?)+)/
             lng_src,lng_trn=$1,$2.split(',')
@@ -1321,18 +1324,12 @@ module SiSU_Commandline
           else
             { bool: false, set: :na }
           end
-          { bool: true, set: :on }
         else
           act[:po4a_lang_trans]= \
           { bool: false, set: :na }
           act[:po4a_lang_init]= \
           { bool: false, set: :na }
-          { bool: false, set: :na }
         end
-        #act[:po4a]=(select_arr.inspect \
-        #=~/"--po4a"|"--pot?"/) \
-        #? { bool: true, set: :on }
-        #: { bool: false, set: :na }
         act[:git]=(select_arr.inspect \
         =~/"--git"/) \
         ? { bool: true, set: :on }
similarity index 99%
rename from lib/sisu/develop/po4a.rb
rename to lib/sisu/develop/src_po4a_shelf.rb
index 285132a5ae72313e96e8f87fe6b9f8f17ed3fdcf..dee6818fbe1b1a7321a374090576baebf62f7f35 100644 (file)
@@ -51,7 +51,7 @@
 
 ** Git
   <http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=summary>
-  <http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=blob;f=lib/sisu/develop/po4a.rb;hb=HEAD>
+  <http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=blob;f=lib/sisu/develop/src_po4a_shelf.rb;hb=HEAD>
 
 =end
 module SiSU_Po4a
@@ -60,7 +60,7 @@ module SiSU_Po4a
     include SiSU_Env
   require_relative 'ao_composite'                       # ao_composite.rb
   require_relative 'shared_metadata'                    # shared_metadata.rb
-  require_relative 'po4a_set'                           # po4a_set.rb
+  require_relative 'src_po4a_shelf_set'                 # src_po4a_shelf_set.rb
   include SiSU_Param
   require_relative 'object_munge'                       # object_munge.rb
   require_relative 'utils_composite'                    # utils_composite.rb
@@ -1102,7 +1102,7 @@ GSUB
           ? @opt.act[:po4a_lang_trans][:trn]
           : []
         end
-        def translation_languages_available
+        def translation_languages_selected_that_are_available
           translation_languages_selected & sisu_languages_available
         end
         def source_language_selected_str
@@ -1110,8 +1110,8 @@ GSUB
           ? @opt.act[:po4a_lang_trans][:src]
           : 'en'
         end
-        def translation_languages_available_str
-          translation_languages_available.join(' ')
+        def translation_languages_selected_that_are_available_str
+          translation_languages_selected_that_are_available.join(' ')
         end
         def translation_languages_selected_str
           @opt.act[:po4a_lang_trans][:trn].join(' ')
@@ -1122,7 +1122,7 @@ GSUB
         doc_import_list=composite_and_imported_filenames_array(@opt.fno)
         po4a_cfg_arr=[]
         po4a_cfg_arr \
-          << "[po4a_langs] #{language.translation_languages_available_str}"
+          << "[po4a_langs] #{language.translation_languages_selected_that_are_available_str}"
         po4a_cfg_arr \
           << "[po4a_paths] #{dir.pot}/$master.pot $lang:#{dir.po}/$lang/$master.po"
         doc_import_list.each do |file_src|
similarity index 99%
rename from lib/sisu/develop/po4a_set.rb
rename to lib/sisu/develop/src_po4a_shelf_set.rb
index d56175fe11e3b11652b285966e8be69e0eb4877d..a281060db693cc5c4ff57c31a70e443c24cb96bf 100644 (file)
@@ -51,7 +51,7 @@
 
 ** Git
   <http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=summary>
-  <http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=blob;f=lib/sisu/develop/po4a_set.rb;hb=HEAD>
+  <http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=blob;f=lib/sisu/develop/src_po4a_shelf_set.rb;hb=HEAD>
 
 =end
 module SiSU_Po4aUtils