rpms/smolt/devel 0001-Client-Hopefully-fix-encoding-trouble.patch, NONE, 1.1 smolt.spec, 1.75, 1.76

Mike McGrath mmcgrath at fedoraproject.org
Mon Sep 21 14:15:18 UTC 2009


Author: mmcgrath

Update of /cvs/pkgs/rpms/smolt/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv21374

Modified Files:
	smolt.spec 
Added Files:
	0001-Client-Hopefully-fix-encoding-trouble.patch 
Log Message:
fixing translations error

0001-Client-Hopefully-fix-encoding-trouble.patch:
 sendProfile.py |    9 +++++----
 smolt.py       |   12 +++++++++++-
 2 files changed, 16 insertions(+), 5 deletions(-)

--- NEW FILE 0001-Client-Hopefully-fix-encoding-trouble.patch ---
>From 7243f1fcc395cdf87815ac5a33c0d2f8b61c0cdf Mon Sep 17 00:00:00 2001
From: Sebastian Pipping <sebastian at pipping.org>
Date: Sun, 20 Sep 2009 21:38:35 +0200
Subject: [PATCH 1/2] Client: Hopefully fix encoding trouble

More or less a squashed cherry-pick from these commits:
- 7592c44f6eef240aaae147ba11ffe85a4156068b
- 81bfa3f0f5172d853f95034e061c4e3a4bd55ebe
- b21ddc39c1e51329a957a463aff3b7db09f5a726
- fa41853f7fcbe5e465bbd25fbe94942a87a5d2bb
---
 client/sendProfile.py |    9 +++++----
 client/smolt.py       |   11 +++++++++++
 2 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/client/sendProfile.py b/client/sendProfile.py
index 46b0f18..ff3a0a9 100644
--- a/client/sendProfile.py
+++ b/client/sendProfile.py
@@ -36,6 +36,7 @@ import smolt
 from smolt import debug
 from smolt import error
 from smolt import get_config_attr
+from smolt import to_ascii
 from scan import scan, rating
 from gate import GateFromConfig
 
@@ -179,10 +180,10 @@ if not opts.autoSend:
         'label_fs_related':_('File system-related'),
         'label_distro_specific':_('Distribution-specific'),
 
-        'general':inner_indent(profile.get_general_info_excerpt()),
-        'devices':inner_indent(profile.get_devices_info_excerpt()),
-        'file_system':inner_indent(profile.get_file_system_info_excerpt()),
-        'distro':inner_indent(profile.get_distro_info_excerpt()),
+        'general':inner_indent(to_ascii(profile.get_general_info_excerpt())),
+        'devices':inner_indent(to_ascii(profile.get_devices_info_excerpt())),
+        'file_system':inner_indent(to_ascii(profile.get_file_system_info_excerpt())),
+        'distro':inner_indent(to_ascii(profile.get_distro_info_excerpt())),
     }
 
     submit = False
diff --git a/client/smolt.py b/client/smolt.py
index dee142f..7016ab6 100644
--- a/client/smolt.py
+++ b/client/smolt.py
@@ -51,6 +51,7 @@ from fs_util import get_fslist
 
 from gate import Gate
 from uuiddb import UuidDb
+import codecs
 
 WITHHELD_MAGIC_STRING = 'WITHHELD'
 SELINUX_ENABLED = 1
@@ -140,6 +141,16 @@ PCI_CLASS_SERIAL_USB =          3
 PCI_CLASS_SERIAL_FIBER =        4
 PCI_CLASS_SERIAL_SMBUS =        5
 
+def to_ascii(o, current_encoding='utf-8'):
+    if not isinstance(o, basestring):
+        return o
+
+    if isinstance(o, unicode):
+        s = o
+    else:
+        s = unicode(o, current_encoding)
+    return codecs.encode(s, 'ascii', 'ignore')
+
 class Device:
     def __init__(self, props, hardware):
         self.UUID = getUUID()
-- 
1.6.2.5



Index: smolt.spec
===================================================================
RCS file: /cvs/pkgs/rpms/smolt/devel/smolt.spec,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -p -r1.75 -r1.76
--- smolt.spec	14 Sep 2009 21:53:33 -0000	1.75
+++ smolt.spec	21 Sep 2009 14:15:18 -0000	1.76
@@ -2,11 +2,12 @@ Name: smolt
 
 Summary: Fedora hardware profiler
 Version: 1.4
-Release: 1%{?dist}
+Release: 2%{?dist}
 License: GPLv2+
 Group: Applications/Internet
 URL: http://fedorahosted.org/smolt
 Source: https://fedorahosted.org/releases/s/m/%{name}/%{name}-%{version}.tar.gz
+Patch0: 0001-Client-Hopefully-fix-encoding-trouble.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 Requires: dbus-python, python-urlgrabber, gawk, python-paste
@@ -68,6 +69,7 @@ ensure that deps are kept small.
 
 %prep
 %setup -q
+%patch0 -p1
 
 %build
 cd client/
@@ -207,6 +209,9 @@ touch --no-create %{_datadir}/icons/hico
 %{_bindir}/smoltGui
 
 %changelog
+* Mon Sep 21 2009 Mike McGrath <mmcgrath at redhat.com> 1.4-2
+- Patched issue with translations (already upstream)
+
 * Mon Sep 14 2009 Mike McGrath <mmcgrath at redhat.com> 1.4-1
 - Upstream released new version
 




More information about the scm-commits mailing list