Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 911631 Details for
Bug 1110325
Unable to input question marks in Wubi-jidian
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
0001-Insert-a-special-candidate-for-the-wildcard-characte.patch
0001-Insert-a-special-candidate-for-the-wildcard-characte.patch (text/plain), 7.59 KB, created by
Mike FABIAN
on 2014-06-24 03:45:13 UTC
(
hide
)
Description:
0001-Insert-a-special-candidate-for-the-wildcard-characte.patch
Filename:
MIME Type:
Creator:
Mike FABIAN
Created:
2014-06-24 03:45:13 UTC
Size:
7.59 KB
patch
obsolete
>From 77a1a5a7a683e463538387684dcc37268aab37e5 Mon Sep 17 00:00:00 2001 >From: Mike FABIAN <mfabian@redhat.com> >Date: Mon, 23 Jun 2014 15:24:47 +0200 >Subject: [PATCH] Insert a special candidate for the wildcard character itself > if only a wildcard character has been typed >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Resolves: rhbz#1110325 - Unable to input question marks in Wubi-jidian >See: https://bugzilla.redhat.com/show_bug.cgi?id=1110325 > >The same problem has been also reported here: > > https://code.google.com/p/ibus/issues/detail?id=1720 > >If only a wildcard character has been typed, insert a special >candidate at the first position for the wildcard character itself. For >example, if â?â is used as a wildcard character and this is the only >character typed, add a candidate ('?', '?', 0, 1000000000) in >halfwidth mode or a candidate ('?', 'ï¼', 0, 1000000000) in fullwidth >mode. This is needed to make it possible to input the wildcard >characters themselves, if â?â acted only as a wildcard it would be >impossible to input a fullwidth question mark. >--- > engine/table.py | 53 +++++++++++++++++++++++++++++++++++++++++---------- > engine/tabsqlitedb.py | 6 +++++- > 2 files changed, 48 insertions(+), 11 deletions(-) > >diff --git a/engine/table.py b/engine/table.py >index 285ed7a..7092057 100644 >--- a/engine/table.py >+++ b/engine/table.py >@@ -206,7 +206,7 @@ class KeyEvent: > > class editor(object): > '''Hold user inputs chars and preedit string''' >- def __init__ (self, config, valid_input_chars, pinyin_valid_input_chars, single_wildcard_char, multi_wildcard_char, auto_wildcard, max_key_length, database): >+ def __init__ (self, config, valid_input_chars, pinyin_valid_input_chars, single_wildcard_char, multi_wildcard_char, auto_wildcard, full_width_letter, full_width_punct, max_key_length, database): > self.db = database > self._config = config > engine_name = os.path.basename(self.db.filename).replace('.db', '') >@@ -218,6 +218,8 @@ class editor(object): > self._single_wildcard_char = single_wildcard_char > self._multi_wildcard_char = multi_wildcard_char > self._auto_wildcard = auto_wildcard >+ self._full_width_letter = full_width_letter >+ self._full_width_punct = full_width_punct > # > # The values below will be reset in self.clear_input_not_committed_to_preedit() > self._chars_valid = u'' # valid user input in table mode >@@ -743,6 +745,31 @@ class editor(object): > single_wildcard_char=self._single_wildcard_char, > multi_wildcard_char=self._multi_wildcard_char, > auto_wildcard=self._auto_wildcard) >+ # If only a wildcard character has been typed, insert a >+ # special candidate at the first position for the wildcard >+ # character itself. For example, if â?â is used as a >+ # wildcard character and this is the only character typed, add >+ # a candidate ('?', '?', 0, 1000000000) in halfwidth mode or a >+ # candidate ('?', 'ï¼', 0, 1000000000) in fullwidth mode. >+ # This is needed to make it possible to input the wildcard >+ # characters themselves, if â?â acted only as a wildcard >+ # it would be impossible to input a fullwidth question mark. >+ if (self._chars_valid >+ in [self._single_wildcard_char, self._multi_wildcard_char]): >+ wildcard_key = self._chars_valid >+ wildcard_phrase = self._chars_valid >+ if ascii_ispunct(wildcard_key): >+ if self._full_width_punct[1]: >+ wildcard_phrase = unichar_half_to_full(wildcard_phrase) >+ else: >+ wildcard_phrase = unichar_full_to_half(wildcard_phrase) >+ else: >+ if self._full_width_letter[1]: >+ wildcard_phrase = unichar_half_to_full(wildcard_phrase) >+ else: >+ wildcard_phrase = unichar_full_to_half(wildcard_phrase) >+ self._candidates.insert( >+ 0, (wildcard_key, wildcard_phrase, 0, 1000000000)) > if self._candidates: > self.fill_lookup_table() > self._candidates_previous = self._candidates >@@ -1059,14 +1086,6 @@ class tabengine (IBus.Engine): > # config module > self._config = self._bus.get_config () > self._config.connect ("value-changed", self.config_value_changed_cb) >- self._editor = editor(self._config, >- self._valid_input_chars, >- self._pinyin_valid_input_chars, >- self._single_wildcard_char, >- self._multi_wildcard_char, >- self._auto_wildcard, >- self._max_key_length, >- self.db) > > self._page_up_keys = [ > IBus.KEY_Page_Up, >@@ -1156,7 +1175,6 @@ class tabengine (IBus.Engine): > self._double_quotation_state = False > self._single_quotation_state = False > >- # [EnMode,TabMode] we get TabMode properties from db > self._full_width_letter = [ > variant_to_value(self._config.get_value( > self._config_section, >@@ -1209,6 +1227,17 @@ class tabengine (IBus.Engine): > else: > self._always_show_lookup = True > >+ self._editor = editor(self._config, >+ self._valid_input_chars, >+ self._pinyin_valid_input_chars, >+ self._single_wildcard_char, >+ self._multi_wildcard_char, >+ self._auto_wildcard, >+ self._full_width_letter, >+ self._full_width_punct, >+ self._max_key_length, >+ self.db) >+ > self._on = False > self._save_user_count = 0 > self._save_user_start = time.time() >@@ -2267,10 +2296,12 @@ class tabengine (IBus.Engine): > return > if name == u'endeffullwidthletter': > self._full_width_letter[0] = value >+ self._editor._full_width_letter[0] = value > self._refresh_properties() > return > if name == u'endeffullwidthpunct': > self._full_width_punct[0] = value >+ self._editor._full_width_punct[0] = value > self._refresh_properties() > return > if name == u'lookuptableorientation': >@@ -2306,10 +2337,12 @@ class tabengine (IBus.Engine): > return > if name == u'tabdeffullwidthletter': > self._full_width_letter[1] = value >+ self._editor._full_width_letter[1] = value > self._refresh_properties() > return > if name == u'tabdeffullwidthpunct': > self._full_width_punct[1] = value >+ self._editor._full_width_punct[1] = value > self._refresh_properties() > return > if name == u'alwaysshowlookup': >diff --git a/engine/tabsqlitedb.py b/engine/tabsqlitedb.py >index f6caf19..6fa4606 100644 >--- a/engine/tabsqlitedb.py >+++ b/engine/tabsqlitedb.py >@@ -898,7 +898,11 @@ class tabsqlitedb: > if not zi: > return u'' > sqlstr = 'SELECT goucima FROM main.goucima WHERE zi = :zi;' >- goucima = self.db.execute(sqlstr, {'zi': zi}).fetchall()[0][0] >+ results = self.db.execute(sqlstr, {'zi': zi}).fetchall() >+ if results: >+ goucima = results[0][0] >+ else: >+ goucima = u'' > return goucima > > def parse_phrase (self, phrase): >-- >1.9.3 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1110325
: 911631