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 299783 Details for
Bug 439909
system-config-services experience various usability problems when locale encoding is not UTF-8
[?]
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]
The diff against version 0.9.17
system-config-services.diff (text/plain), 6.39 KB, created by
Andrew Zabolotny
on 2008-03-31 22:45:45 UTC
(
hide
)
Description:
The diff against version 0.9.17
Filename:
MIME Type:
Creator:
Andrew Zabolotny
Created:
2008-03-31 22:45:45 UTC
Size:
6.39 KB
patch
obsolete
>diff -ur old/serviceconf.py ./serviceconf.py >--- old/serviceconf.py 2007-10-15 22:06:00.000000000 +0400 >+++ ./serviceconf.py 2008-03-31 23:27:09.000000000 +0400 >@@ -57,22 +57,11 @@ > from servicemethods import * > from rhpl.translate import _, N_, cat > >-## >-## I18N >-## >-import gettext >-gettext.bindtextdomain(domain, "/usr/share/locale") >-gettext.textdomain(domain) >-try: >- gettext.install(domain, "/usr/share/locale", 1) >-except IOError: >- import __builtin__ >- __builtin__.__dict__['_'] = unicode >-_=gettext.gettext >- > quitting = 0 > VERSION = "0.9.17" > >+cat.setDomain (domain) >+ > def verify_delete(arg): > message=_("Are you sure you want to delete the %s?") % arg > dlg = gtk.MessageDialog(None, 0, gtk.MESSAGE_INFO, >@@ -321,6 +310,9 @@ > self.bgListServices.get_selection().select_path((0,)) > self.changed(self.bgListServices.get_selection(), self.bgListServices) > >+ # Set the current_selected field properly >+ self.set_current_selected(0) >+ > #### select runlevel #### > map(lambda x: self.bgListServices.set_column_visible(x, 0), range(0, 7)) > if self.editing_runlevel == "3" or self.editing_runlevel == "2" or self.editing_runlevel == "1": >@@ -413,7 +405,6 @@ > > def set_status_buffer(self, buf): > # set the text in {bg,od}TxtStatus >- print self.text_in_row > if not self.services.has_key(self.text_in_row): > status = UNKNOWN > message = _("Unknown") >@@ -428,7 +419,6 @@ > # on demand/xinetd service > status = UNKNOWN > message = self.services["xinetd"].status_message >- print message > buf.set_text(message) > > def toggled_service(self, toggle, row, column, list): >@@ -681,10 +671,7 @@ > def local_button_press_cb(self, clist, event): > """checks to see if the third mouse button was clicked. If it was, then bring up the popup menu""" > row=clist.get_path_at_pos(int(event.x),int(event.y))[0][0] >- self.text_in_row = self.bgListServices.get_text(int(row),7) >- self.current_selected = self.bgListServices.get_text(int(row),7) >- self.set_desc_buffer(self.bgTxtDescBuffer) >- self.set_status_buffer(self.bgTxtStatusBuffer) >+ self.set_current_selected(row) > if (event.button == 3): > self.popupMenu = self.xml.get_widget("popup_menu") > >@@ -695,6 +682,13 @@ > self.popupMenu.popup(None, None, None, event.button, event.time) > > >+ def set_current_selected(self, row): >+ self.text_in_row = self.bgListServices.get_text(int(row),7) >+ self.current_selected = self.bgListServices.get_text(int(row),7) >+ self.set_desc_buffer(self.bgTxtDescBuffer) >+ self.set_status_buffer(self.bgTxtStatusBuffer) >+ >+ > def save_revert_sensitive(self, sensitive): > """sets the save and revert buttons and menus to be sensitive or not, sensitive is a 1 or 0""" > self.mnuSave.set_sensitive(sensitive) >diff -ur old/servicemethods.py ./servicemethods.py >--- old/servicemethods.py 2007-10-15 22:06:00.000000000 +0400 >+++ ./servicemethods.py 2008-03-31 00:24:29.000000000 +0400 >@@ -26,6 +26,7 @@ > import re, os > from rhpl.translate import _, N_, cat > import copy >+import locale > > import nonblockingreader > >@@ -39,6 +40,8 @@ > > if text[-1:] == '\n': > text = text[:-1] >+ # Program output is always in user's locale encoding, convert to utf-8 >+ text = text.decode (locale.getpreferredencoding ()).encode ("utf-8") > return status, text > > # ============================================================================ >@@ -47,6 +50,7 @@ > RUNNING = 1 > STOPPED = 2 > ERROR = 4 >+NOLANG = "LC_ALL=C LC_MESSAGES=C LANG=C " > > class Service: > """Represents a service with start script in /etc/init.d >@@ -127,7 +131,7 @@ > """ > status = UNKNOWN > try: >- message = getstatusoutput("LC_ALL=C /sbin/service " + self.name + " status", self.uicallback)[1] >+ message = getstatusoutput("/sbin/service " + self.name + " status", self.uicallback)[1] > except: > return (UNKNOWN, "") > >@@ -174,7 +178,7 @@ > """calls chkconfig --level editing_runlevel on if on, off if not on""" > chkconfig_action = ("on", "off")[not on] > try: >- getstatusoutput("LC_ALL=C /sbin/chkconfig --level %s %s %s" % (editing_runlevels, self.name, chkconfig_action), self.uicallback) >+ getstatusoutput("/sbin/chkconfig --level %s %s %s" % (editing_runlevels, self.name, chkconfig_action), self.uicallback) > except IOError: > pass > >@@ -324,7 +328,7 @@ > """calls chkconfig on/off""" > chkconfig_action = ("on", "off")[not on] > try: >- getstatusoutput("LC_ALL=C /sbin/chkconfig %s %s" % >+ getstatusoutput("/sbin/chkconfig %s %s" % > (self.name, chkconfig_action), self.uicallback) > except IOError: > pass >@@ -406,7 +410,7 @@ > > def add_service(self, servicename): > """calls chkconfig --add servicename""" >- result = getstatusoutput("LC_ALL=C /sbin/chkconfig --add %s" % >+ result = getstatusoutput("/sbin/chkconfig --add %s" % > (servicename), self.uicallback) > self.update(servicename) > return result >@@ -415,7 +419,7 @@ > > def delete_service(self, servicename): > """calls chkconfig --del servicename""" >- result = getstatusoutput("LC_ALL=C /sbin/chkconfig --del %s" % >+ result = getstatusoutput("/sbin/chkconfig --del %s" % > (servicename), self.uicallback) > self.update(servicename) > return result >@@ -454,7 +458,7 @@ > self._xinetd_services = {} > > chkconfig_list = getstatusoutput( >- "LC_ALL=C /sbin/chkconfig --list %s 2>/dev/null" % servicename, >+ NOLANG + "/sbin/chkconfig --list %s 2>/dev/null" % servicename, > self.uicallback)[1] > > chkconfig_list = chkconfig_list.splitlines() >@@ -480,7 +484,7 @@ > def update(self, servicename): > """Read status of service from disk. If service got removed > remove from ourselfs""" >- status, output = getstatusoutput("LC_ALL=C /sbin/chkconfig --list " + >+ status, output = getstatusoutput(NOLANG + "/sbin/chkconfig --list " + > servicename, self.uicallback) > if status == 0: > service = self._service_from_chkconfig(output)
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 439909
: 299783