[Sugar-devel] [PATCH sugar] Control Panel: making about my computer section hardware independent, OLPC #11232

Peter Robinson pbrobinson at gmail.com
Mon Oct 17 05:14:12 EDT 2011


On Mon, Oct 17, 2011 at 10:07 AM, Simon Schampijer <simon at schampijer.de> wrote:
> On 10/17/2011 10:37 AM, Simon Schampijer wrote:
>>
>> On 10/17/2011 09:36 AM, James Cameron wrote:
>>>
>>> On Mon, Oct 17, 2011 at 09:23:18AM +0200, Simon Schampijer wrote:
>>>>
>>>> def _parse_firmware_number(firmware_no):
>>>> if firmware_no is None:
>>>> firmware_no = _not_available
>>>> else:
>>>> # try to extract Open Firmware version from OLPC style
>>>> # version string, e.g. "CL2 Q4B11 Q4B"
>>>> fields = re.split(' +', firmware_no)
>>>> if len(fields) == 3:
>>>> firmware_no = fields[1]
>>>> return firmware_no
>>>
>>> Again I disagree with this method, since it expects whitespace between
>>> fields, and OpenFirmware does not guarantee whitespace.
>>>
>>> Instead, you should extract byte positions. Skip six characters, then
>>> extract seven characters. Trim any trailing spaces from the result.
>>>
>>> Mitch and I discussed this during this last week.
>>
>> Ok, I can firmware_no[6:13] but how do you differentiate then with a
>> version number you would get on powerpc like 'OpenFirmware 3'?
>>
>> Regards,
>> Simon
>
> I discussed this a bit with James on irc.
>
> - powerpc is not a popular Sugar platform to make an enormous effort for
> supporting it

Nothing to stop us improving that in the future if the situation changes?

> - displaying all of the string on both cases (OLPC/powerpc) will likely
> confuse people used to the old humanized string that is displayed at current
>
> - the string does always start with "CL": CL1 for XO-1, CL1B for XO-1.5, CL2
> for XO-1.75, to differentiate we can do the following:
>
> if: string.startswith('CL') string[6:13]
> else: display all of the string
>
> And we add a comment about it. Sounds a good enough compromise for now?

I think so.

Peter


More information about the Sugar-devel mailing list