fix bug of aborting when creating a web-album at first launch of booh (when ~/.booh...
authorgc <gc>
Sun, 14 Aug 2005 20:51:25 +0000 (20:51 +0000)
committergc <gc>
Sun, 14 Aug 2005 20:51:25 +0000 (20:51 +0000)
bin/booh
bin/booh-backend

index da9101df30619e29e1a1b0a71b82561504edccde..9025f6b4e98ed1db31bda69770e64d4405b039ff 100755 (executable)
--- a/bin/booh
+++ b/bin/booh
@@ -172,9 +172,8 @@ def current_dest_dir
     return make_dest_filename(from_utf8($current_path.sub(/^#{Regexp.quote(source)}/, dest)))
 end
 
-def full_src_dir_to_rel(path)
-    source = from_utf8($xmldoc.root.attributes['source'])
-    return path.sub(/^#{Regexp.quote(source)}/, '')
+def full_src_dir_to_rel(path, source)
+    return path.sub(/^#{Regexp.quote(from_utf8(source))}/, '')
 end
 
 def build_full_dest_filename(filename)
@@ -1449,15 +1448,15 @@ def backend_wait_message(parent, msg, infopipe_path, mode)
             if line =~ /^directories: (\d+), sizes: (\d+)/
                 directories = $1.to_f + 1
                 sizes = $2.to_f
-            elsif line =~ /^walking: (.+), (\d+) elements$/
-                elements = $2.to_f + 1
+            elsif line =~ /^walking: (.+)\|(.+), (\d+) elements$/
+                elements = $3.to_f + 1
                 if mode == 'web-album'
                     elements += sizes
                 end
                 element_counter = 0
                 gtk_thread_protect { pb1_1.fraction = 0 }
                 if mode != 'one dir scan'
-                    newtext = utf8(full_src_dir_to_rel($1))
+                    newtext = utf8(full_src_dir_to_rel($1, $2))
                     newtext = '/' if newtext == ''
                     gtk_thread_protect { pb1_2.text = newtext }
                     directories_counter += 1
@@ -1475,8 +1474,8 @@ def backend_wait_message(parent, msg, infopipe_path, mode)
                 gtk_thread_protect { pb1_2.text = utf8(_("finished")) }
                 gtk_thread_protect { pb1_1.fraction = pb1_2.fraction = 1 }
                 directories_counter = 0
-            elsif line =~ /^index.html: (.+)/
-                newtext = utf8(full_src_dir_to_rel($1))
+            elsif line =~ /^index.html: (.+)\|(.+)/
+                newtext = utf8(full_src_dir_to_rel($1, $2))
                 newtext = '/' if newtext == ''
                 gtk_thread_protect { pb2.text = newtext }
                 directories_counter += 1
index ae81bc0fc4fbc8da43f7e1ec1b4b453010c2912a..253d1638e0900a39ed8cb3159189227cd4a65cd9 100755 (executable)
@@ -549,7 +549,7 @@ def walk_source_dir
         xmldir = optxpath[utf8(dir)]
         if $mode == 'use_config' || $mode == 'use_config_changetheme'
             if !xmldir || (xmldir.attributes['already-generated'] && !$force) || xmldir.attributes['deleted']
-                info("walking: #{dir}, 0 elements")
+                info("walking: #{dir}|#{$source}, 0 elements")
                 next
             end
         else
@@ -613,7 +613,7 @@ def walk_source_dir
         msg 3, _("\t%s images") % images.length
         videos = entries.find_all { |e| entry2type(e) == 'video' }
         msg 3, _("\t%s videos") % videos.length
-        info("walking: #{dir}, #{images.length + videos.length} elements")
+        info("walking: #{dir}|#{$source}, #{images.length + videos.length} elements")
 
         dest_dir = make_dest_filename(dir.sub(/^#{Regexp.quote($source)}/, $dest))
         system("mkdir -p '#{dest_dir}'")
@@ -899,7 +899,7 @@ def walk_source_dir
 
     examined_dirs.each { |dir|
         dir.chomp!
-        info("index.html: #{dir}")
+        info("index.html: #{dir}|#{$source}")
 
         xmldir = optxpath[utf8(dir)]
         if !xmldir || (xmldir.attributes['already-generated'] && !$force) || xmldir.attributes['deleted']