]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/gtk/_core.py
Tests for UTF-8 and PUA characters and octal escapes
[wxWidgets.git] / wxPython / src / gtk / _core.py
index f50bb232c849f826e01df8b0adcbd5fe6c2127b0..335ff9c25547ce03b300da2ea8ab53c4827febd5 100644 (file)
@@ -2113,6 +2113,31 @@ class ImageHistogram(object):
         """
         return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
 
+    def GetCount(*args, **kwargs):
+        """
+        GetCount(self, unsigned long key) -> unsigned long
+
+        Returns the pixel count for the given key.  Use `MakeKey` to create a
+        key value from a RGB tripple.
+        """
+        return _core_.ImageHistogram_GetCount(*args, **kwargs)
+
+    def GetCountRGB(*args, **kwargs):
+        """
+        GetCountRGB(self, unsigned char r, unsigned char g, unsigned char b) -> unsigned long
+
+        Returns the pixel count for the given RGB values.
+        """
+        return _core_.ImageHistogram_GetCountRGB(*args, **kwargs)
+
+    def GetCountColour(*args, **kwargs):
+        """
+        GetCountColour(self, Colour colour) -> unsigned long
+
+        Returns the pixel count for the given `wx.Colour` value.
+        """
+        return _core_.ImageHistogram_GetCountColour(*args, **kwargs)
+
 
 class ImageHistogramPtr(ImageHistogram):
     def __init__(self, this):
@@ -11238,18 +11263,21 @@ if RELEASE_VERSION != _core_.RELEASE_VERSION:
 # different on different platforms.  For example, please see
 # http://www.alanwood.net/demos/charsetdiffs.html for differences
 # between the common latin/roman encodings.
-import locale
-import codecs
-try:
-    default = locale.getdefaultlocale()[1]
-    codecs.lookup(default)
-except (ValueError, LookupError):
-    default = _sys.getdefaultencoding()
+
+default = _sys.getdefaultencoding()
+if default == 'ascii':
+    import locale
+    import codecs
+    try:
+        default = locale.getdefaultlocale()[1]
+        codecs.lookup(default)
+    except (ValueError, LookupError):
+        default = _sys.getdefaultencoding()
+    del locale
+    del codecs
 if default:
     wx.SetDefaultPyEncoding(default)
 del default
-del locale
-del codecs
 
 #----------------------------------------------------------------------------