fix my xpath to make it work with ruby 1.8.3
authorgc <gc>
Fri, 19 Aug 2005 21:46:18 +0000 (21:46 +0000)
committergc <gc>
Fri, 19 Aug 2005 21:46:18 +0000 (21:46 +0000)
bin/booh
bin/booh-backend
lib/booh/booh-lib.rb

index 44f34a557badc84369f95926317dfb3c5850a398..299d5be06950fa2cc179893e66a1b2d41e869fe4 100755 (executable)
--- a/bin/booh
+++ b/bin/booh
@@ -753,7 +753,7 @@ def add_thumbnail(autotable, filename, type, thumbnail_img, caption)
     }
 
     rotate_and_cleanup = Proc.new { |angle|
-        rotate(angle, thumbnail_img, img, $xmldir.elements["[@filename='#{filename}']"], '', $default_thumbnails[:x], $default_thumbnails[:y])
+        rotate(angle, thumbnail_img, img, $xmldir.elements["*[@filename='#{filename}']"], '', $default_thumbnails[:x], $default_thumbnails[:y])
         cleanup_all_thumbnails.call
     }
 
@@ -784,7 +784,7 @@ def add_thumbnail(autotable, filename, type, thumbnail_img, caption)
 
     color_swap_and_cleanup = Proc.new {
         perform_color_swap_and_cleanup = Proc.new {
-            color_swap($xmldir.elements["[@filename='#{filename}']"], '')
+            color_swap($xmldir.elements["*[@filename='#{filename}']"], '')
             my_gen_real_thumbnail.call
         }
 
@@ -808,7 +808,7 @@ def add_thumbnail(autotable, filename, type, thumbnail_img, caption)
 
     change_frame_offset_and_cleanup_real = Proc.new { |values|
         perform_change_frame_offset_and_cleanup = Proc.new { |val|
-            change_frame_offset($xmldir.elements["[@filename='#{filename}']"], '', val)
+            change_frame_offset($xmldir.elements["*[@filename='#{filename}']"], '', val)
             my_gen_real_thumbnail.call
         }
         perform_change_frame_offset_and_cleanup.call(values[:new])
@@ -829,18 +829,18 @@ def add_thumbnail(autotable, filename, type, thumbnail_img, caption)
     }
 
     change_frame_offset_and_cleanup = Proc.new {
-        if values = ask_new_frame_offset($xmldir.elements["[@filename='#{filename}']"], '')
+        if values = ask_new_frame_offset($xmldir.elements["*[@filename='#{filename}']"], '')
             change_frame_offset_and_cleanup_real.call(values)
         end
     }
 
     whitebalance_and_cleanup = Proc.new {
         if values = ask_whitebalance(from_utf8("#{$current_path}/#{filename}"), thumbnail_img, img,
-                                     $xmldir.elements["[@filename='#{filename}']"], '', $default_thumbnails[:x], $default_thumbnails[:y], '')
+                                     $xmldir.elements["*[@filename='#{filename}']"], '', $default_thumbnails[:x], $default_thumbnails[:y], '')
             perform_change_whitebalance_and_cleanup = Proc.new { |val|
-                change_whitebalance($xmldir.elements["[@filename='#{filename}']"], '', val)
+                change_whitebalance($xmldir.elements["*[@filename='#{filename}']"], '', val)
                 recalc_whitebalance(val, from_utf8("#{$current_path}/#{filename}"), thumbnail_img, img,
-                                    $xmldir.elements["[@filename='#{filename}']"], '', $default_thumbnails[:x], $default_thumbnails[:y], '')
+                                    $xmldir.elements["*[@filename='#{filename}']"], '', $default_thumbnails[:x], $default_thumbnails[:y], '')
                 cleanup_all_thumbnails.call
             }
             perform_change_whitebalance_and_cleanup.call(values[:new])
@@ -863,7 +863,7 @@ def add_thumbnail(autotable, filename, type, thumbnail_img, caption)
 
     enhance_and_cleanup = Proc.new {
         perform_enhance_and_cleanup = Proc.new {
-            enhance($xmldir.elements["[@filename='#{filename}']"], '')
+            enhance($xmldir.elements["*[@filename='#{filename}']"], '')
             my_gen_real_thumbnail.call
         }
 
@@ -1083,7 +1083,7 @@ def add_thumbnail(autotable, filename, type, thumbnail_img, caption)
             if !$ignore_next_release
                 x, y = autotable.get_current_pos(vbox)
                 next_ = autotable.get_next_widget(vbox)
-                popup_thumbnail_menu(event, ['delete'], type, $xmldir.elements["[@filename='#{filename}']"], '',
+                popup_thumbnail_menu(event, ['delete'], type, $xmldir.elements["*[@filename='#{filename}']"], '',
                                      { :can_left => x > 0, :can_right => next_ && autotable.get_current_pos(next_)[0] > x,
                                        :can_up => y > 0, :can_down => y < autotable.get_max_y, :can_multiple => true },
                                      { :rotate => rotate_and_cleanup, :move => move, :color_swap => color_swap_and_cleanup, :enhance => enhance_and_cleanup,
index a2605f73c4cfd559f76a87924aeabcd852cfcbd6..4b2035d5947701eb0efb68858c1fa3c6b2b7ab65 100755 (executable)
@@ -317,7 +317,7 @@ def build_html_skeletons
 end
 
 def find_caption_value(xmldir, filename)
-    if cap = xmldir.elements["[@filename='#{utf8(filename)}']"].attributes['caption']
+    if cap = xmldir.elements["*[@filename='#{utf8(filename)}']"].attributes['caption']
         return cap.gsub("\n", '<br/>')
     else
         return nil
index 9e3717291f892483aaf18f3cd20b94892b323d39..e2b4d80c5e8ba46b888819019d87a6f1486ed8f3 100644 (file)
@@ -232,7 +232,7 @@ module Booh
 
     def gen_thumbnails_element(orig, xmldirorelem, allow_background, dests)
         if xmldirorelem.name == 'dir'
-            xmldirorelem = xmldirorelem.elements["[@filename='#{utf8(File.basename(orig))}']"]
+            xmldirorelem = xmldirorelem.elements["*[@filename='#{utf8(File.basename(orig))}']"]
         end
         gen_thumbnails(orig, allow_background, dests, xmldirorelem, '')
     end