/[thuban]/branches/WIP-pyshapelib-bramz/Thuban/UI/__init__.py
ViewVC logotype

Annotation of /branches/WIP-pyshapelib-bramz/Thuban/UI/__init__.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 230 - (hide annotations)
Fri Jul 19 13:21:14 2002 UTC (22 years, 7 months ago) by bh
Original Path: trunk/thuban/Thuban/UI/__init__.py
File MIME type: text/x-python
File size: 1058 byte(s)
* Thuban/UI/main.py, Thuban/UI/__init__.py: Move the work-around
for the wxPython locale bug to __init__.py so that it's
automatically executed by anybody using UI code from Thuban.

1 bh 230 # Copyright (c) 2001, 2002 by Intevation GmbH
2 bh 6 # Authors:
3     # Bernhard Herzog <[email protected]>
4     #
5     # This program is free software under the GPL (>=v2)
6     # Read the file COPYING coming with Thuban for details.
7 bh 230
8    
9     # Work-around for a locale related bug in wxPython (which is fixed in
10     # 2.3)
11     #
12     # we can probably safely assume that any program that imports the
13     # Thuban.UI module will use wxPython, so we put the fix here.
14     #
15     # Import wxPython.wx here to get the side effects of the wxPython
16     # import, especially setting the locale to the user's defaults throught
17     # GTK. We then set the locale again to the user's defaults, but this
18     # time we're going through the standard python locale module, so all the
19     # magic necessary to make python work properly is done. Without this,
20     # something harmless like float("1.2") may fail when run under a non-C
21     # locale like de_DE
22     import wxPython.wx
23     del wxPython
24     try:
25     import locale
26     locale.setlocale(locale.LC_ALL, "")
27     del locale
28     except ImportError:
29     # the locale module may not be available on some systems
30     pass
31    

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26