https://bugzilla.novell.com/show_bug.cgi?id=846591
https://bugzilla.novell.com/show_bug.cgi?id=846591#c2
--- Comment #2 from Johannes Meixner 2013-10-18 16:26:22 CEST ---
As far as I understand the last lines in my attachment564039
----------------------------------------------------------------------------
2013-10-18 12:45:19 <1> g108(6899) [Ruby] modules/Printer.rb:1545
The driver_filter_string is: '^hp.*laserjet.*1220'
2013-10-18 12:45:20 <3> g108(6899) [Ruby] yast/wfm.rb:86
Client call failed with invalid byte sequence in UTF-8 and back trace
["/usr/lib/ruby/vendor_ruby/2.0.0/yast/builtins.rb:876:in `downcase'",
"/usr/lib/ruby/vendor_ruby/2.0.0/yast/builtins.rb:876:in `tolower'",
"/usr/share/YaST2/modules/Printer.rb:1575:in `block in DriverItems'",
----------------------------------------------------------------------------
the matching Ruby code in yast2-printer is in
/usr/share/YaST2/modules/Printer.rb (in the installed system)
----------------------------------------------------------------------------
# cat -n /usr/share/YaST2/modules/Printer.rb \
| egrep 'DriverItems|The driver_filter_string is: |tolower'
..
1490 def DriverItems(driver_filter_string, preselection)
1546 "The driver_filter_string is: '%1'",
1575 Builtins.tolower(nickname),
..
----------------------------------------------------------------------------
The full code beween line 1490 and 1575 is (long lines wrapped here):
----------------------------------------------------------------------------
def DriverItems(driver_filter_string, preselection)
if Ops.less_than(Builtins.size(@ppds), 1)
if !CreateDatabase()
Popup.Error(
# Only a simple message because before the function CreateDatabase
# was called and this function would have shown more specific messages.
_("Failed to create the printer driver database.")
)
# Return an empty list:
return []
end
end
driver_items = []
sorted_driver_items = []
driver_string = ""
# If the driver_filter_string is the special string "BasicAddDialog",
# produce a special fast output which is suitable to be shown
# initially when the BasicAddDialog is launched:
if "BasicAddDialog" == driver_filter_string
if preselection && Ops.greater_or_equal(@selected_ppds_index, 0)
# if preselection should be done at all:
driver_string = Ops.add(
Ops.add(
Ops.add(
Ops.get(@ppds, [@selected_ppds_index, "nickname"], ""),
" ["
),
Ops.get(@ppds, [@selected_ppds_index, "ppd"], "")
),
"]"
)
driver_items = [Item(Id(@selected_ppds_index), driver_string, true)]
else
# fallback entry for a SelectionBox when no connection is selected.
# It will be replaced by real content, when a connection is selected.
driver_string = _(
"Select a connection, then matching drivers show up here."
)
driver_items = [Item(Id(-1), driver_string)]
# Invalidate selected_ppds_index to be on the safe side.
# Otherwise it is possible to set up a queue with a previously selected
driver
# even if the current dialog does not show it.
@selected_ppds_index = -1
end
return deep_copy(driver_items)
end
# Make a list of the NickName entries of the PPDs according to the PPD
database
# and take the driver_filter_string into account (if it is not the empty
string)
# and try to preselect an entry according to a selected autodetected printer:
Popup.ShowFeedback(
"",
# Busy message:
# Body of a Popup::ShowFeedback:
_("Determining matching printer drivers...")
)
Builtins.y2milestone(
"The driver_filter_string is: '%1'",
driver_filter_string
)
ppds_index = -1
Builtins.foreach(@ppds) do |ppd_entry|
ppds_index = Ops.add(ppds_index, 1)
# Use local variables to have shorter variable names:
ppd = Ops.get(ppd_entry, "ppd", "")
nickname = Ops.get(ppd_entry, "nickname", "")
deviceID = Ops.get(ppd_entry, "deviceID", "")
language = Ops.get(ppd_entry, "language", "")
# Skip effectively empty (i.e. useless) entries:
next if "" == ppd || "" == nickname
# Build the entry:
driver_string = Ops.add(Ops.add(Ops.add(nickname, " ["), ppd), "]")
# Take the filter_string into account:
if "" == driver_filter_string
driver_items = Builtins.add(
driver_items,
Item(Id(ppds_index), driver_string)
)
else
# test whether nickname or deviceID matches to the driver_filter_string.
# Only the special character '+' is also taken into account because
# this is also a meaningful character in the model name.
# For example the '+' at the end of a Kyocera model name
# indicates that this model has a built-in PostScript interpreter
# while the model without the '+' understands only PCL.
unified_nickname = Builtins.filterchars(
Builtins.tolower(nickname),
----------------------------------------------------------------------------
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.