[lightlang] r946 committed - Рефакторинг

1 view
Skip to first unread message

ligh...@googlecode.com

unread,
Feb 21, 2010, 6:04:54 PM2/21/10
to ligh...@googlegroups.com
Revision: 946
Author: mdevaev
Date: Sun Feb 21 15:03:58 2010
Log: Рефакторинг
http://code.google.com/p/lightlang/source/detail?r=946

Modified:
/trunk/lightlang/apps/xsl/src/pyqt4/SlWordSearch.py

=======================================
--- /trunk/lightlang/apps/xsl/src/pyqt4/SlWordSearch.py Thu Jan 21 06:56:46
2010
+++ /trunk/lightlang/apps/xsl/src/pyqt4/SlWordSearch.py Sun Feb 21 15:03:58
2010
@@ -73,10 +73,10 @@

#####

- self.replaces_list = [
- ["<font class=\"info_font\">This word is not found</font>", tr("<font
class=\"info_font\">This word is not found</font>")],
- ["<font class=\"info_font\">No dict is connected</font>", tr("<font
class=\"info_font\">No dict is connected</font>")]
- ]
+ self.replaces_dict = {
+ "<font class=\"info_font\">This word is not found</font>" : tr("<font
class=\"info_font\">This word is not found</font>"),
+ "<font class=\"info_font\">No dict is connected</font>" : tr("<font
class=\"info_font\">No dict is connected</font>")
+ }

#####

@@ -173,8 +173,8 @@

text = Qt.QString.fromLocal8Bit(str(self.proc_output))

- for replaces_list_item in self.replaces_list :
- text.replace(replaces_list_item[0], replaces_list_item[1])
+ for replaces_dict_key_item in self.replaces_dict.keys() :
+ text.replace(replaces_dict_key_item,
self.replaces_dict[replaces_dict_key_item])

if self.proc_args[3] == UsuallySearchOption or self.proc_args[3] ==
WordCombinationsSearchOption :
self.textChangedSignal(text)
Reply all
Reply to author
Forward
0 new messages