[Sugar-devel] [PATCH] Fix battery maxint to use gobject constant instead of the sys module constant

Simon Schampijer simon at schampijer.de
Wed Aug 8 11:15:59 EDT 2012


Ack'ed, as well following the discussion at 
https://bugzilla.gnome.org/show_bug.cgi?id=680005

Simon

On 08/08/2012 03:17 PM, Manuel Quiñones wrote:
> Otherwise gives OverflowError in 64 bits systems.  When porting to
> GTK+3 should be: GObject.G_MAXINT32
>
> Signed-off-by: Manuel Quiñones <manuq at laptop.org>
> ---
>   extensions/deviceicon/battery.py |    3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/extensions/deviceicon/battery.py b/extensions/deviceicon/battery.py
> index a70458a..8e1cd8e 100644
> --- a/extensions/deviceicon/battery.py
> +++ b/extensions/deviceicon/battery.py
> @@ -16,7 +16,6 @@
>
>   import logging
>   from gettext import gettext as _
> -import sys
>
>   import gconf
>   import glib
> @@ -171,7 +170,7 @@ class BatteryPalette(Palette):
>   class DeviceModel(gobject.GObject):
>       __gproperties__ = {
>           'level': (int, None, None, 0, 100, 0, gobject.PARAM_READABLE),
> -        'time-remaining': (int, None, None, 0, sys.maxint, 0,
> +        'time-remaining': (int, None, None, 0, gobject.constants.G_MAXINT32, 0,
>                              gobject.PARAM_READABLE),  # unit: seconds
>           'charging': (bool, None, None, False, gobject.PARAM_READABLE),
>           'discharging': (bool, None, None, False, gobject.PARAM_READABLE),
>



More information about the Sugar-devel mailing list