[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gpsd-dev] [PATCH 08/12] Removes unnecessary Unicode literal from xgps.
From: |
Fred Wright |
Subject: |
[gpsd-dev] [PATCH 08/12] Removes unnecessary Unicode literal from xgps. |
Date: |
Fri, 8 Apr 2016 10:07:49 -0700 |
Since the radio-button labels in the add_ui_from_string() text are
just internal labels not visible to the user, there's no reason that
they need to rely on non-USASCII characters. With that text confined
to 7-bit ASCII, there's no need to use Unicode for the literal, which
in turn eliminates the last incompatibility with Python 3.2. Note
that this isn't the only case where the internal labels mismatch the
user-visible text (the other ones involve embedded blanks).
The fact that Gtk3 assumes 'ascii' for the encoding in this case may
actually be a bug.
TESTED:
Ran xgps with Python 2.7 and 3.2-3.5 (using appropriately built
extensions).
---
xgps | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/xgps b/xgps
index 62cdb3a..d43ff7d 100755
--- a/xgps
+++ b/xgps
@@ -510,12 +510,12 @@ class Base:
'Metric Units', 2),
], 0, lambda a, _unused: self.set_units(['i', 'n',
'm'][a.get_current_value()]))
self.actiongroup.add_radio_actions(
- [('30°', None, '30°', None, '30°', 30),
- ('45°', None, '45°', None, '45°', 45),
+ [('30deg', None, '30°', None, '30°', 30),
+ ('45deg', None, '45°', None, '45°', 45),
('Off', None, 'Off', None, 'Off', 0),
], 45, lambda a, _unused:
self.set_step_of_grid(a.get_current_value()))
self.uimanager.insert_action_group(self.actiongroup, 0)
- self.uimanager.add_ui_from_string(u'''
+ self.uimanager.add_ui_from_string('''
<ui>
<menubar name="MenuBar">
<menu action="File">
@@ -535,8 +535,8 @@ class Base:
<menuitem action="Metric"/>
</menu>
<menu action="Step of grid">
- <menuitem action="30°"/>
- <menuitem action="45°"/>
+ <menuitem action="30deg"/>
+ <menuitem action="45deg"/>
<menuitem action="Off"/>
</menu>
</menubar>
--
2.8.0
- [gpsd-dev] Python 3 Updates, Fred Wright, 2016/04/08
- [gpsd-dev] [PATCH 01/12] Fixes Python C extensions for Python 3 compatibility., Fred Wright, 2016/04/08
- [gpsd-dev] [PATCH 02/12] Fixes fake.py 'packet' import for Python 3., Fred Wright, 2016/04/08
- [gpsd-dev] [PATCH 04/12] Fixes xgps for Python 3., Fred Wright, 2016/04/08
- [gpsd-dev] [PATCH 05/12] Fixes a client.py exception for Python 3., Fred Wright, 2016/04/08
- [gpsd-dev] [PATCH 06/12] Fixes Gtk warnings related to xgps/xgpsspeed error boxes., Fred Wright, 2016/04/08
- [gpsd-dev] [PATCH 07/12] Changes type checks in misc.py:isotime to use isinstance()., Fred Wright, 2016/04/08
- [gpsd-dev] [PATCH 03/12] Forces Python 3 import behavior in all gps/* modules., Fred Wright, 2016/04/08
- [gpsd-dev] [PATCH 09/12] Fixes gpscat and test_maidenhead.py for Python 3., Fred Wright, 2016/04/08
- [gpsd-dev] [PATCH 08/12] Removes unnecessary Unicode literal from xgps.,
Fred Wright <=
- [gpsd-dev] [PATCH 10/12] Fixes fake.py and gpsfake for Python 3., Fred Wright, 2016/04/08
- [gpsd-dev] [PATCH 12/12] Removes redundant polystr/polybytes defs from client.py., Fred Wright, 2016/04/08
- [gpsd-dev] [PATCH 11/12] Adds "target Python" support to SConstruct., Fred Wright, 2016/04/08
- Re: [gpsd-dev] Python 3 Updates, Gary E. Miller, 2016/04/08
- Re: [gpsd-dev] Python 3 Updates, Eric S. Raymond, 2016/04/09
- Re: [gpsd-dev] Python 3 Updates, Fred Wright, 2016/04/09