[Dextrose] [PATCH] sdxo#2754: "My Settings" -> "About My Computer" -> "Model" for "XO4-HS" should be shown as "XO Duo"

Bernie Innocenti bernie at sugarlabs.org
Wed Jan 16 10:51:17 EST 2013


This is not a complete review, but...

On Wed, 2013-01-16 at 11:12 +0530, Hari Madhav Purwar wrote:
> Signed-off-by: Hari Madhav Purwar <hmpurwar at activitycentral.com>
> ---
>  extensions/cpsection/aboutcomputer/model.py | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> 
> diff --git a/extensions/cpsection/aboutcomputer/model.py b/extensions/cpsection/aboutcomputer/model.py
> index bed69ea..7fc3bb8 100644
> --- a/extensions/cpsection/aboutcomputer/model.py
> +++ b/extensions/cpsection/aboutcomputer/model.py
> @@ -150,8 +150,18 @@ def get_model_laptop():
>      elif os.path.exists(_JUMPC):
>          model = 'JumPc'
>  
> +    #Removing trailing binary-unprintable character

Insert a space between '#' and the comment.
Also, it's more customary to say "Remove" instead of "Removing".

> +    model = model.rstrip('\x00')
> +
>      if model is None or not model:
>          model = _not_available
> +
> +    if _is_model_change_required():
> +        model_converter = { 'XO-4 HS Touch' : 'XO Duo' }
> +
> +        if model in model_converter:
> +            model = model_converter.get(model)
> +
>      return model
>  
> 
> @@ -367,3 +377,10 @@ def get_act():
>          for seccion in parser.sections():
>              version = "%s%s: %s\n" %(version,seccion,parser.get(seccion,'version'))
>      return version
> +
> +
> +def _is_model_change_required():
> +    from gi.repository import GConf
> +    client = GConf.Client.get_default()
> +
> +    return client.get_bool('/desktop/sugar/extensions/aboutcomputer/change_model') is True

-- 
Bernie Innocenti
Sugar Labs Infrastructure Team
http://wiki.sugarlabs.org/go/Infrastructure_Team



More information about the Dextrose mailing list