Re: [Sugar-devel] Downgrading firmware

2011-10-09 Thread James Cameron
Obtain a developer key, disable security, then use the flash command.

(I don't believe signed firmware installation method on secured laptop
will permit downgrade.)

You may find de...@lists.laptop.org more appropriate than sugar-devel@
for XO-1 related firmware questions.

Please identify which part of the Wiki you don't understand?

-- 
James Cameron
http://quozl.linux.org.au/
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] Downgrading firmware

2011-10-09 Thread Alan Jhonn Aguiar Schwyn

Hello!
I want to downgrading the firmware of an XO 1.0 for the Q2E45 to Q2E41...
The information in the Wiki I don't understand...
Is an secure laptop (not have Ok prompt)..
Regards
Alan
  ___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] Sugar Labs Oversight Board - Candidacy

2011-10-09 Thread David Farning
I, David Farning, would like to announce my candidacy for a position
on the Sugar Labs Oversight Board.

As a member on the original Sugar Labs Oversight Board, I came to feel
that as much as I believed in the vision of OLPC and Sugar Labs there
were a number of needs in the ecosystem which could be met by a third
organization.
1. The voice and needs of deployments were being over shadowed by the
global voice of Sugar Labs and OLPC.
2. There was no organization provide service and support for
deployments. As a result, deployments required a significant amount of
technical sophistication before they could get started.
3. Because of the volunteer nature of Sugar Labs, developers tended to
work on the interesting and innovative problems rather than the daily
grind necessary to deliver a fully polished educational platform.

For the past two years I, and a number of other developers, have been
establishing Activity Central [1] to help fill the above needs. Our
model is to provide technical service and support to deployments. This
effort has resulted in the Dextrose [2] operation system which we
custom develop and support for several large and small deployment.
Because we depend on customer revenue for our sustainability we have a
strong incentive to meet the software needs of deployments.

Because Dextrose is based on Upstream Sugar and OLPC OS releases
Activity Central has a strong incentive to assist in the continued
success of Sugar Labs and OLPC. To this end we have made a number of
commitments:
1. All code written by Activity Central developers will be released
with an open source license.
2. Activity Central developers spend 60% of their time on revenue
generating work. They are free to spend the remaining 40% of their
time on projects which are of general value to the ecosystem.
3. Activity Central supports a Community Architect whose job is
identify and support local and global communities that are valuable
parts of the Sugar Labs and OLPC ecosystem.

>From time to time I am asked why I chose to form a third organization
rather than work within Sugar Labs or OLPC. A third global
organization brings several advantages to the ecosystem:
1. It promotes cooperative decision making.  When the ecosystem
consisted of two primary participants, Sugar Labs and OLP, there was a
tendency for competitive decision making. When a third player was
added to the mix, the value of cooperative decision making become more
apparent.
2. Organizations with a business focus often provide value to a Free
Software ecosystem. Interestingly OLPC-A has seen this and has been
shifting toward a 'social entrepreneurship' model.
3. Activity Central approaches the ecosystem from a different
viewpoint than either sugar Labs or OLPC. As global innovators both
Sugar Labs' and OLPC's strengths are top down. Ideas and
Implementations flow down from the central organization to deployments
and users. As a service provider, most of Activity Central's ideas and
implementation flow up from deployments and user. Our work flow is to
solve issues faced by individual deployments which we generalize and
push upstream.

thank you,
David Farning

1. http://activitycentral.com/
2. http://wiki.sugarlabs.org/go/Dextrose
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] Downgrading firmware

2011-10-09 Thread Alan Jhonn Aguiar Schwyn


Hello!
I want to downgrading the firmware of an XO 1.0 for the Q2E45 to Q2E41...
The information in the Wiki I don't understand...
Is an secure laptop (not have Ok prompt)..
Regards
Alan  ___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [Marketing] Sugar on a Stick v5 Coconut release

2011-10-09 Thread Rafael Ortiz
On Sun, Oct 9, 2011 at 2:51 PM, Peter Robinson  wrote:

> And replying to myself.
>
> On Sun, Oct 9, 2011 at 8:31 PM, Peter Robinson 
> wrote:
> > Hi All,
> >
> > Sugar on a Stick v5 is ready to go (finally). The website will be
> > updated shortly. When it is all details will be here
> >
> > http://spins.fedoraproject.org/soas/
> >
> > Improvements over SoaSv4 include:
> > - Sugar 0.92.4
> > - Fedora 15
> > - Network Manager 0.9 support (massive thanks to dsd!)
> > - More Activities!
> > - Many bugfixes and improvements
> > - Improved HW support including better WiFi, notebook/netbook and
> > other devices support
> >
> > Regressions:
> > - 3G Modem support currently doesn't work.
>
> Activities added:
> - Abacus
> - Clock
> - Speak
> - Memorize
> - Surf
>
>
Nice congratulations!.


> Browse was also substituted for Surf due to API changes with xulrunner
>
> Peter
> ___
> Marketing mailing list
> market...@lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/marketing
>
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [Marketing] Sugar on a Stick v5 Coconut release

2011-10-09 Thread Peter Robinson
On Sun, Oct 9, 2011 at 10:00 PM, Thomas C Gilliard
 wrote:
>
>
> Peter Robinson wrote:
>
> On Sun, Oct 9, 2011 at 9:38 PM, Thomas C Gilliard
>  wrote:
>
>
> Peter Robinson wrote:
>
>
> Hi All,
>
> Sugar on a Stick v5 is ready to go (finally). The website will be
> updated shortly. When it is all details will be here
>
> http://spins.fedoraproject.org/soas/
>
>
>
> Peter;
> will a copy of the .ks file(s)  be available?
> (for building remixes with livecd-tools)

Thomas, please keep the thread on topic. And yes, the kickstart is
always available.

Peter
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [Marketing] Sugar on a Stick v5 Coconut release

2011-10-09 Thread Thomas C Gilliard



Peter Robinson wrote:

On Sun, Oct 9, 2011 at 9:38 PM, Thomas C Gilliard
 wrote:
  

Peter Robinson wrote:


Hi All,

Sugar on a Stick v5 is ready to go (finally). The website will be
updated shortly. When it is all details will be here

http://spins.fedoraproject.org/soas/

  

Peter;
will a copy of the .ks file(s)  be available?
(for building remixes with livecd-tools)

Thanks;

Tom Gilliard
  

Congratulations
Will the surf-115.xo on ASLO get a revision for use with sugar 0.93-94.x?



Its patched and working in F-16 with build sugar-surf-115-2.fc16

Peter

  
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [Marketing] Sugar on a Stick v5 Coconut release

2011-10-09 Thread Peter Robinson
On Sun, Oct 9, 2011 at 9:38 PM, Thomas C Gilliard
 wrote:
>
>
> Peter Robinson wrote:
>>
>> Hi All,
>>
>> Sugar on a Stick v5 is ready to go (finally). The website will be
>> updated shortly. When it is all details will be here
>>
>> http://spins.fedoraproject.org/soas/
>>
>>
>
> Congratulations
> Will the surf-115.xo on ASLO get a revision for use with sugar 0.93-94.x?

Its patched and working in F-16 with build sugar-surf-115-2.fc16

Peter
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [Marketing] Sugar on a Stick v5 Coconut release

2011-10-09 Thread Thomas C Gilliard



Peter Robinson wrote:

Hi All,

Sugar on a Stick v5 is ready to go (finally). The website will be
updated shortly. When it is all details will be here

http://spins.fedoraproject.org/soas/

  

Congratulations
Will the surf-115.xo on ASLO get a revision for use with sugar 0.93-94.x?

Thanks again : )

Tom Gilliard

Improvements over SoaSv4 include:
- Sugar 0.92.4
- Fedora 15
- Network Manager 0.9 support (massive thanks to dsd!)
- More Activities!
- Many bugfixes and improvements
- Improved HW support including better WiFi, notebook/netbook and
other devices support

Regressions:
- 3G Modem support currently doesn't work.

ISOs in the mean time can be downloaded from the following links:
32 bit http://koji.fedoraproject.org/koji/taskinfo?taskID=3355572
64 bit http://koji.fedoraproject.org/koji/taskinfo?taskID=3355573

Regards,
Peter
___
Marketing mailing list
market...@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/marketing

  

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Sugar on a Stick v5 Coconut release

2011-10-09 Thread Peter Robinson
On Sun, Oct 9, 2011 at 9:02 PM, Art Hunkins  wrote:
>
> - Original Message - From: "Peter Robinson" 
> To: ; "Development of live Sugar
> distributions" ; "Sugar Labs Marketing"
> 
> Sent: Sunday, October 09, 2011 3:51 PM
> Subject: Re: [Sugar-devel] Sugar on a Stick v5 Coconut release
>
>
>> Browse was also substituted for Surf due to API changes with xulrunner
>
> Did you mean the opposite?

We ship Surf, not Browse.

Peter
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Sugar on a Stick v5 Coconut release

2011-10-09 Thread Art Hunkins


- Original Message - 
From: "Peter Robinson" 
To: ; "Development of live Sugar 
distributions" ; "Sugar Labs Marketing" 


Sent: Sunday, October 09, 2011 3:51 PM
Subject: Re: [Sugar-devel] Sugar on a Stick v5 Coconut release



Browse was also substituted for Surf due to API changes with xulrunner


Did you mean the opposite?

Art Hunkins



Peter
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel 


___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Sugar on a Stick v5 Coconut release

2011-10-09 Thread Peter Robinson
And replying to myself.

On Sun, Oct 9, 2011 at 8:31 PM, Peter Robinson  wrote:
> Hi All,
>
> Sugar on a Stick v5 is ready to go (finally). The website will be
> updated shortly. When it is all details will be here
>
> http://spins.fedoraproject.org/soas/
>
> Improvements over SoaSv4 include:
> - Sugar 0.92.4
> - Fedora 15
> - Network Manager 0.9 support (massive thanks to dsd!)
> - More Activities!
> - Many bugfixes and improvements
> - Improved HW support including better WiFi, notebook/netbook and
> other devices support
>
> Regressions:
> - 3G Modem support currently doesn't work.

Activities added:
- Abacus
- Clock
- Speak
- Memorize
- Surf

Browse was also substituted for Surf due to API changes with xulrunner

Peter
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [Marketing] Sugar on a Stick v5 Coconut release

2011-10-09 Thread Walter Bender
On Sun, Oct 9, 2011 at 3:31 PM, Peter Robinson  wrote:
> Hi All,
>
> Sugar on a Stick v5 is ready to go (finally).

Great news. Thanks for all the hard work. And thanks to everyone who
contributed!!

-walter

> The website will be
> updated shortly. When it is all details will be here
>
> http://spins.fedoraproject.org/soas/
>
> Improvements over SoaSv4 include:
> - Sugar 0.92.4
> - Fedora 15
> - Network Manager 0.9 support (massive thanks to dsd!)
> - More Activities!
> - Many bugfixes and improvements
> - Improved HW support including better WiFi, notebook/netbook and
> other devices support
>
> Regressions:
> - 3G Modem support currently doesn't work.
>
> ISOs in the mean time can be downloaded from the following links:
> 32 bit http://koji.fedoraproject.org/koji/taskinfo?taskID=3355572
> 64 bit http://koji.fedoraproject.org/koji/taskinfo?taskID=3355573
>
> Regards,
> Peter
> ___
> Marketing mailing list
> market...@lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/marketing
>



-- 
Walter Bender
Sugar Labs
http://www.sugarlabs.org
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] Sugar on a Stick v5 Coconut release

2011-10-09 Thread Peter Robinson
Hi All,

Sugar on a Stick v5 is ready to go (finally). The website will be
updated shortly. When it is all details will be here

http://spins.fedoraproject.org/soas/

Improvements over SoaSv4 include:
- Sugar 0.92.4
- Fedora 15
- Network Manager 0.9 support (massive thanks to dsd!)
- More Activities!
- Many bugfixes and improvements
- Improved HW support including better WiFi, notebook/netbook and
other devices support

Regressions:
- 3G Modem support currently doesn't work.

ISOs in the mean time can be downloaded from the following links:
32 bit http://koji.fedoraproject.org/koji/taskinfo?taskID=3355572
64 bit http://koji.fedoraproject.org/koji/taskinfo?taskID=3355573

Regards,
Peter
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


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

2011-10-09 Thread Sascha Silbe
Excerpts from Simon Schampijer's message of 2011-10-09 18:01:35 +0200:

> The serial number is often only readable by root on non-XO
> hardware, that is why we do not read it. If the serial number
> can not be found on an XO we display the entry as 'Not available'.
[...]

> -def get_firmware_number():
> -firmware_no = None
> -if os.path.exists(os.path.join(_OFW_TREE, _MODEL)):
> -firmware_no = _read_file(os.path.join(_OFW_TREE, _MODEL))
> -elif os.path.exists(os.path.join(_PROC_TREE, _MODEL)):
> -firmware_no = _read_file(os.path.join(_PROC_TREE, _MODEL))
> +def _parse_olpc_firmware_number(firmware_no):
>  if firmware_no is None:
>  firmware_no = _not_available
>  else:
> @@ -111,6 +107,21 @@ def get_firmware_number():
>  return firmware_no
>  
>  
> +def get_firmware_number():
> +firmware_no = None
> +if os.path.exists(os.path.join(_OFW_TREE, _MODEL)):
> +firmware_no = _read_file(os.path.join(_OFW_TREE, _MODEL))
> +firmware_no = _parse_olpc_firmware_number(firmware_no)
> +elif os.path.exists(os.path.join(_PROC_TREE, _MODEL)):
> +firmware_no = _read_file(os.path.join(_PROC_TREE, _MODEL))
> +firmware_no = _parse_olpc_firmware_number(firmware_no)
> +elif os.path.exists(os.path.join(_DMI_DIRECTORY, 'bios_version')):
> +firmware_no = _read_file(os.path.join(_DMI_DIRECTORY, 
> 'bios_version'))
> +if firmware_no is None:
> +firmware_no = _not_available
> +return firmware_no

[...]

There still seems to be some confusion over what is available on
various systems (esp. "non-XOs"), so here are a few real-life examples:


== Apple eMac (powerpc) ==

{{{
sascha.silbe@emac:~$ uname -r
2.6.32-5-powerpc
sascha.silbe@emac:~$ tr '\0' '\n' < /proc/device-tree/model
PowerMac4,4
sascha.silbe@emac:~$ tr '\0' '\n' < /proc/device-tree/openprom/model
OpenFirmware 3
sascha.silbe@emac:~$ tr '\0' '\n' < /proc/device-tree/banner-name
-bash: /proc/device-tree/banner-name: No such file or directory
sascha.silbe@emac:~$ tr '\0' '\n' < /proc/device-tree/compatible 
PowerMac4,4
MacRISC2
MacRISC
Power Macintosh
sascha.silbe@emac:~$ tr '\0' '\n' < /proc/device-tree/serial-number |sed -e 
's/[A-Za-z]/A/g' -e 's/[0-9]/0/g' |grep -v '^$'
A0A
AAAA0
sascha.silbe@emac:~$ ls /sys/class/dmi/id
ls: cannot access /sys/class/dmi/id: No such file or directory
sascha.silbe@emac:~$ cat /proc/cpuinfo 
processor   : 0
cpu : 7455, altivec supported
clock   : 999.97MHz
revision: 3.3 (pvr 8001 0303)
bogomips: 66.57
timebase: 33289815
platform: PowerMac
model   : PowerMac4,4
machine : PowerMac4,4
motherboard : PowerMac4,4 MacRISC2 MacRISC Power Macintosh
detected as : 80 (eMac)
pmac flags  : 0010
L2 cache: 256K unified
pmac-generation : NewWorld
Memory  : 640 MB
}}}


== OpenRD Ultimate (armel) ==

{{{
sascha.silbe@flatty:~$ uname -r
2.6.32-5-kirkwood
sascha.silbe@flatty:~$ ls /proc/device-tree
ls: cannot access /proc/device-tree: No such file or directory
sascha.silbe@flatty:~$ ls /sys/class/dmi/id
ls: cannot access /sys/class/dmi/id: No such file or directory
sascha.silbe@flatty:~$ cat /proc/cpuinfo 
Processor   : Feroceon 88FR131 rev 1 (v5l)
BogoMIPS: 1199.30
Features: swp half thumb fastmult edsp 
CPU implementer : 0x56
CPU architecture: 5TE
CPU variant : 0x2
CPU part: 0x131
CPU revision: 1

Hardware: Marvell OpenRD Ultimate Board
Revision: 
Serial  : 
}}}


== Athlon64 based PC (amd64) ==

{{{
sascha.silbe@twin:~$ uname -r
2.6.32-5-amd64
sascha.silbe@twin:~$ ls /proc/device-tree
ls: cannot access /proc/device-tree: No such file or directory
sascha.silbe@twin:~$ cat /sys/class/dmi/id/product_name 
GA-MA78G-DS3H
sascha.silbe@twin:~$ cat /sys/class/dmi/id/product_version 
 
sascha.silbe@twin:~$ cat /sys/class/dmi/id/bios_vendor 
Award Software International, Inc.
sascha.silbe@twin:~$ cat /sys/class/dmi/id/bios_version
F3
}}}


== XO-1.5 (i386) ==

{{{
sascha.silbe@xo15-sascha:~$ uname -r
2.6.35.13-xo1.5-2-00905-g483bf23
sascha.silbe@xo15-sascha:~$ ls /proc/device-tree
ls: cannot access /proc/device-tree: No such file or directory
sascha.silbe@xo15-sascha:~$ tr '\0' '\n' < /ofw/model
D4
sascha.silbe@xo15-sascha:~$ tr '\0' '\n' < /ofw/compatible
-bash: /ofw/compatible: No such file or directory
sascha.silbe@xo15-sascha:~$ tr '\0' '\n' < /ofw/openprom/model
CL1   Q3A64  Q3A
sascha.silbe@xo15-sascha:~$ cat /sys/class/dmi/id/product_name 
XO
sascha.silbe@xo15-sascha:~$ cat /sys/class/dmi/id/product_version 
1.5
sascha.silbe@xo15-sascha:~$ cat /sys/class/dmi/id/bios_vendor
 IE8y2D ScD%g4r2bAIFA.
sascha.silbe@xo15-sascha:~$ cat /sys/class/dmi/id/bios_version 
OLPC Ver 1.00.15
}}}


== XO-1.75 (armel) ==

{{{
sascha.silbe@mimosa:~$ uname -r
3.0.0-mimosa-1-00159-g1abf0b6
sascha.silbe@mimosa:~$ tr '\0' '\n' < /proc/device-tree/model
1B1
sascha.silbe@mimo

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

2011-10-09 Thread Simon Schampijer

On 10/09/2011 05:22 PM, Sascha Silbe wrote:

Excerpts from Simon Schampijer's message of 2011-10-09 12:54:40 +0200:


@@ -58,6 +58,8 @@ def get_serial_number():
   serial_no = _read_file(os.path.join(_OFW_TREE, _SN))
   elif os.path.exists(os.path.join(_PROC_TREE, _SN)):
   serial_no = _read_file(os.path.join(_PROC_TREE, _SN))
+else:
+return None
   if serial_no is None:
   serial_no = _not_available
   return serial_no


We are hiding the serial number completely if the kernel doesn't expose
device tree information, but show "Not available" if the file couldn't
be read or parsed. That doesn't really match the patch description.

How about:

def get_serial_number():
  if os.path.exists(os.path.join(_OFW_TREE, _SN)):
  return _read_file(os.path.join(_OFW_TREE, _SN))
  elif os.path.exists(os.path.join(_PROC_TREE, _SN)):
  return _read_file(os.path.join(_PROC_TREE, _SN))
  elif os.path.exists(os.path.join(_DMI_DIRECTORY, 'board_serial'):
  return _read_file(os.path.join(_DMI_DIRECTORY, 'board_serial'))
  return None


Ahh, maybe not as clear from the description. The board_serial is only
readable by root. Knowing that it does not really make sense to try to
read it.


Ah, it's really just the board_serial that's readable by root only by
default; I assumed the same was true for bios_version. In that case it
makes sense not to bother with board_serial for now (i.e. until we have
a downstream that makes board_serial readable for the user running Sugar).

I suggest the following tweak to the description:

The serial number is usually only readable by root on x86 based
hardware, so we don't bother trying. If no serial number can be
determined (for any reason) we hide that part of the section.



That is why I special cased displaying the serial number. The
behavior has not changed to previous code, so I think it is good like
that, espacially as a bug fix patch.


Well, the behaviour does change for Firmware and Wireless Firmware.
Before they were hidden, now they show 'Not available'. So why the
special-casing just for the serial number?

I don't care much either way (with a slight preference towards 'Not
available'), but we should be consistent.

Sascha


Ok, great _ I am d'accord with always displaying the entries, as well 
for the serial number. The new patch does that, good to push now?


Regards,
   Simon

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


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

2011-10-09 Thread Simon Schampijer
'/ofw' is not used anymore on the XO, '/proc/device-tree' is used now
instead. Instead of just adjusting for that change we took the
chance to make the section hardware independent. As the firmware
version we display the bios version if available on non XO
hardware. As ethtool has become a depedency of Sugar we can now
display the wireless firmware as well on any hardware.

The serial number is often only readable by root on non-XO
hardware, that is why we do not read it. If the serial number
can not be found on an XO we display the entry as 'Not available'.

The patch has been tested on XO 1, 1.5, 1.75 and on a Thinkpad T61.

Signed-off-by: Simon Schampijer 
---
 extensions/cpsection/aboutcomputer/model.py |   23 +++---
 extensions/cpsection/aboutcomputer/view.py  |   65 +--
 2 files changed, 48 insertions(+), 40 deletions(-)

diff --git a/extensions/cpsection/aboutcomputer/model.py 
b/extensions/cpsection/aboutcomputer/model.py
index a02eee6..503be60 100644
--- a/extensions/cpsection/aboutcomputer/model.py
+++ b/extensions/cpsection/aboutcomputer/model.py
@@ -35,6 +35,7 @@ _NM_DEVICE_TYPE_WIFI = 2
 
 _OFW_TREE = '/ofw'
 _PROC_TREE = '/proc/device-tree'
+_DMI_DIRECTORY = '/sys/class/dmi/id'
 _SN = 'serial-number'
 _MODEL = 'openprom/model'
 
@@ -96,12 +97,7 @@ def print_build_number():
 print get_build_number()
 
 
-def get_firmware_number():
-firmware_no = None
-if os.path.exists(os.path.join(_OFW_TREE, _MODEL)):
-firmware_no = _read_file(os.path.join(_OFW_TREE, _MODEL))
-elif os.path.exists(os.path.join(_PROC_TREE, _MODEL)):
-firmware_no = _read_file(os.path.join(_PROC_TREE, _MODEL))
+def _parse_olpc_firmware_number(firmware_no):
 if firmware_no is None:
 firmware_no = _not_available
 else:
@@ -111,6 +107,21 @@ def get_firmware_number():
 return firmware_no
 
 
+def get_firmware_number():
+firmware_no = None
+if os.path.exists(os.path.join(_OFW_TREE, _MODEL)):
+firmware_no = _read_file(os.path.join(_OFW_TREE, _MODEL))
+firmware_no = _parse_olpc_firmware_number(firmware_no)
+elif os.path.exists(os.path.join(_PROC_TREE, _MODEL)):
+firmware_no = _read_file(os.path.join(_PROC_TREE, _MODEL))
+firmware_no = _parse_olpc_firmware_number(firmware_no)
+elif os.path.exists(os.path.join(_DMI_DIRECTORY, 'bios_version')):
+firmware_no = _read_file(os.path.join(_DMI_DIRECTORY, 'bios_version'))
+if firmware_no is None:
+firmware_no = _not_available
+return firmware_no
+
+
 def print_firmware_number():
 print get_firmware_number()
 
diff --git a/extensions/cpsection/aboutcomputer/view.py 
b/extensions/cpsection/aboutcomputer/view.py
index e5f2f32..257e165 100644
--- a/extensions/cpsection/aboutcomputer/view.py
+++ b/extensions/cpsection/aboutcomputer/view.py
@@ -16,7 +16,6 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 
-import os
 from gettext import gettext as _
 
 import gtk
@@ -47,8 +46,7 @@ class AboutComputer(SectionView):
 scrollwindow.add_with_viewport(self._vbox)
 self._vbox.show()
 
-if os.path.exists('/ofw'):
-self._setup_identity()
+self._setup_identity()
 
 self._setup_software()
 self._setup_copyright()
@@ -127,37 +125,36 @@ class AboutComputer(SectionView):
 box_software.pack_start(box_sugar, expand=False)
 box_sugar.show()
 
-if os.path.exists('/ofw'):
-box_firmware = gtk.HBox(spacing=style.DEFAULT_SPACING)
-label_firmware = gtk.Label(_('Firmware:'))
-label_firmware.set_alignment(1, 0)
-label_firmware.modify_fg(gtk.STATE_NORMAL,
-  style.COLOR_SELECTION_GREY.get_gdk_color())
-box_firmware.pack_start(label_firmware, expand=False)
-self._group.add_widget(label_firmware)
-label_firmware.show()
-label_firmware_no = gtk.Label(self._model.get_firmware_number())
-label_firmware_no.set_alignment(0, 0)
-box_firmware.pack_start(label_firmware_no, expand=False)
-label_firmware_no.show()
-box_software.pack_start(box_firmware, expand=False)
-box_firmware.show()
-
-box_wireless_fw = gtk.HBox(spacing=style.DEFAULT_SPACING)
-label_wireless_fw = gtk.Label(_('Wireless Firmware:'))
-label_wireless_fw.set_alignment(1, 0)
-label_wireless_fw.modify_fg(gtk.STATE_NORMAL,
-  style.COLOR_SELECTION_GREY.get_gdk_color())
-box_wireless_fw.pack_start(label_wireless_fw, expand=False)
-self._group.add_widget(label_wireless_fw)
-label_wireless_fw.show()
-wireless_fw_no = self._model.get_wireless_firmware()
-label_wireless_fw_no = gtk.Label(wireless_fw_no)
-label_wi

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

2011-10-09 Thread Sascha Silbe
Excerpts from Simon Schampijer's message of 2011-10-09 12:54:40 +0200:

> >> @@ -58,6 +58,8 @@ def get_serial_number():
> >>   serial_no = _read_file(os.path.join(_OFW_TREE, _SN))
> >>   elif os.path.exists(os.path.join(_PROC_TREE, _SN)):
> >>   serial_no = _read_file(os.path.join(_PROC_TREE, _SN))
> >> +else:
> >> +return None
> >>   if serial_no is None:
> >>   serial_no = _not_available
> >>   return serial_no
> >
> > We are hiding the serial number completely if the kernel doesn't expose
> > device tree information, but show "Not available" if the file couldn't
> > be read or parsed. That doesn't really match the patch description.
> >
> > How about:
> >
> > def get_serial_number():
> >  if os.path.exists(os.path.join(_OFW_TREE, _SN)):
> >  return _read_file(os.path.join(_OFW_TREE, _SN))
> >  elif os.path.exists(os.path.join(_PROC_TREE, _SN)):
> >  return _read_file(os.path.join(_PROC_TREE, _SN))
> >  elif os.path.exists(os.path.join(_DMI_DIRECTORY, 'board_serial'):
> >  return _read_file(os.path.join(_DMI_DIRECTORY, 'board_serial'))
> >  return None
> 
> Ahh, maybe not as clear from the description. The board_serial is only 
> readable by root. Knowing that it does not really make sense to try to 
> read it.

Ah, it's really just the board_serial that's readable by root only by
default; I assumed the same was true for bios_version. In that case it
makes sense not to bother with board_serial for now (i.e. until we have
a downstream that makes board_serial readable for the user running Sugar).

I suggest the following tweak to the description:

The serial number is usually only readable by root on x86 based
hardware, so we don't bother trying. If no serial number can be
determined (for any reason) we hide that part of the section.


> That is why I special cased displaying the serial number. The 
> behavior has not changed to previous code, so I think it is good like 
> that, espacially as a bug fix patch.

Well, the behaviour does change for Firmware and Wireless Firmware.
Before they were hidden, now they show 'Not available'. So why the
special-casing just for the serial number?

I don't care much either way (with a slight preference towards 'Not
available'), but we should be consistent.

Sascha

-- 
http://sascha.silbe.org/
http://www.infra-silbe.de/


signature.asc
Description: PGP signature
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH] Update alpha according to filter after events in neighborhoodview icons - SL #3091 -v2

2011-10-09 Thread Simon Schampijer

On 10/07/2011 08:47 PM, godi...@sugarlabs.org wrote:

From: Gonzalo Odiard

The neighboard view use alpha to show the applied filter.
When the state of a ap change the graphic representation
is updated and the alpha should be restored acording the filter value.

v2 - As suggested by Simon by irc,moved the call to update_color in the class
OlpcMeshView to  __device_state_changed_cb

Signed-off-by: Gonzalo Odiard


Thanks Gonzalo, pushed as: cb3e8866337f4d2b639f8dc74ac45459ab820a4b 
Since it fixes a regression I pushed to the stable branch as well.


Regards,
   Simon

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH 2/2] Only activate keyboard configuration if it was configured, OLPC #11175

2011-10-09 Thread Daniel Drake
On Sun, Oct 9, 2011 at 11:33 AM, Simon Schampijer  wrote:
> Hmm, the original bug that git fixed by that was #1717 [1] from the
> description: "Since we do not supply a keyboard model by default, xfree86
> gets picked up, and as a result the arrow keys, etc do not work on Xephyr.
> We should use evdev instead."
>
> However with or without your patches the arrow keys do not work for me on
> Xephyr (jhbuild F14). Not sure if that was ever fixed at all...

Thanks, noted this in the commit message and pushed.
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


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

2011-10-09 Thread Simon Schampijer
'/ofw' is not used anymore on the XO, '/proc/device-tree' is used now
instead. Instead of just adjusting for that change we took the
chance to make the section hardware independent. As the firmware
version we display the bios version if available on non XO
hardware. As ethtool has become a depedency of Sugar we can now
display the wireless firmware as well on all hardwares.

The serial number is often only readable by root on non-XO
hardware. If the serial number can not be found on an XO we hide
that part of the section.

The patch has been tested on XO 1, 1.5, 1.75 and on a Thinkpad T61.

Signed-off-by: Simon Schampijer 
---
 extensions/cpsection/aboutcomputer/model.py |   25 +++--
 extensions/cpsection/aboutcomputer/view.py  |   70 +-
 2 files changed, 54 insertions(+), 41 deletions(-)

diff --git a/extensions/cpsection/aboutcomputer/model.py 
b/extensions/cpsection/aboutcomputer/model.py
index a02eee6..304a697 100644
--- a/extensions/cpsection/aboutcomputer/model.py
+++ b/extensions/cpsection/aboutcomputer/model.py
@@ -35,6 +35,7 @@ _NM_DEVICE_TYPE_WIFI = 2
 
 _OFW_TREE = '/ofw'
 _PROC_TREE = '/proc/device-tree'
+_DMI_DIRECTORY = '/sys/class/dmi/id'
 _SN = 'serial-number'
 _MODEL = 'openprom/model'
 
@@ -58,6 +59,8 @@ def get_serial_number():
 serial_no = _read_file(os.path.join(_OFW_TREE, _SN))
 elif os.path.exists(os.path.join(_PROC_TREE, _SN)):
 serial_no = _read_file(os.path.join(_PROC_TREE, _SN))
+else:
+return None
 if serial_no is None:
 serial_no = _not_available
 return serial_no
@@ -96,12 +99,7 @@ def print_build_number():
 print get_build_number()
 
 
-def get_firmware_number():
-firmware_no = None
-if os.path.exists(os.path.join(_OFW_TREE, _MODEL)):
-firmware_no = _read_file(os.path.join(_OFW_TREE, _MODEL))
-elif os.path.exists(os.path.join(_PROC_TREE, _MODEL)):
-firmware_no = _read_file(os.path.join(_PROC_TREE, _MODEL))
+def _parse_olpc_firmware_number(firmware_no):
 if firmware_no is None:
 firmware_no = _not_available
 else:
@@ -111,6 +109,21 @@ def get_firmware_number():
 return firmware_no
 
 
+def get_firmware_number():
+firmware_no = None
+if os.path.exists(os.path.join(_OFW_TREE, _MODEL)):
+firmware_no = _read_file(os.path.join(_OFW_TREE, _MODEL))
+firmware_no = _parse_olpc_firmware_number(firmware_no)
+elif os.path.exists(os.path.join(_PROC_TREE, _MODEL)):
+firmware_no = _read_file(os.path.join(_PROC_TREE, _MODEL))
+firmware_no = _parse_olpc_firmware_number(firmware_no)
+elif os.path.exists(os.path.join(_DMI_DIRECTORY, 'bios_version')):
+firmware_no = _read_file(os.path.join(_DMI_DIRECTORY, 'bios_version'))
+if firmware_no is None:
+firmware_no = _not_available
+return firmware_no
+
+
 def print_firmware_number():
 print get_firmware_number()
 
diff --git a/extensions/cpsection/aboutcomputer/view.py 
b/extensions/cpsection/aboutcomputer/view.py
index e5f2f32..a1af4c1 100644
--- a/extensions/cpsection/aboutcomputer/view.py
+++ b/extensions/cpsection/aboutcomputer/view.py
@@ -16,7 +16,6 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 
-import os
 from gettext import gettext as _
 
 import gtk
@@ -47,13 +46,15 @@ class AboutComputer(SectionView):
 scrollwindow.add_with_viewport(self._vbox)
 self._vbox.show()
 
-if os.path.exists('/ofw'):
-self._setup_identity()
+self._setup_identity()
 
 self._setup_software()
 self._setup_copyright()
 
 def _setup_identity(self):
+serial_number = self._model.get_serial_number()
+if serial_number is None:
+return
 separator_identity = gtk.HSeparator()
 self._vbox.pack_start(separator_identity, expand=False)
 separator_identity.show()
@@ -74,7 +75,7 @@ class AboutComputer(SectionView):
 box_identity.pack_start(label_serial, expand=False)
 self._group.add_widget(label_serial)
 label_serial.show()
-label_serial_no = gtk.Label(self._model.get_serial_number())
+label_serial_no = gtk.Label(serial_number)
 label_serial_no.set_alignment(0, 0)
 box_identity.pack_start(label_serial_no, expand=False)
 label_serial_no.show()
@@ -127,37 +128,36 @@ class AboutComputer(SectionView):
 box_software.pack_start(box_sugar, expand=False)
 box_sugar.show()
 
-if os.path.exists('/ofw'):
-box_firmware = gtk.HBox(spacing=style.DEFAULT_SPACING)
-label_firmware = gtk.Label(_('Firmware:'))
-label_firmware.set_alignment(1, 0)
-label_firmware.modify_fg(gtk.STATE_NORMAL,
-  style.COLOR_SELECTION_GREY.get_gdk_color())
-box_firmware.pack_start(label_firmware, expand=False)
-self.

Re: [Sugar-devel] [PATCH v3] Remove hippo from the frame

2011-10-09 Thread Daniel Drake
On Sat, Oct 8, 2011 at 10:38 PM, Sascha Silbe  wrote:
> Excerpts from Daniel Drake's message of 2011-10-03 11:49:46 +0200:
>
>> Based on earlier work by Raul Gutierrez and Walter Bender.
> [...]
>
> Looks good, thanks!
>
> Acked-By: Sascha Silbe 

pushed, thanks
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH] SpreadLayout: fix grid cell allocation

2011-10-09 Thread Daniel Drake
On Sat, Oct 8, 2011 at 9:00 PM, Sascha Silbe  wrote:
> Excerpts from Daniel Drake's message of 2011-10-05 23:05:16 +0200:
>> The calculation of how many grid cells to assign a child element
>> has a bug in that it rounds down instead of up.
> [...]
>
> Thanks for the patch (including the great description)!
>
> Acked-By: Sascha Silbe 

pushed thanks
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


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

2011-10-09 Thread Simon Schampijer

On 10/08/2011 09:57 PM, Sascha Silbe wrote:

Excerpts from Simon Schampijer's message of 2011-10-07 11:13:15 +0200:

'/ofw' is not used anymore on the XO, '/proc/device-tree' is used now
instead. Instead of just adjusting for that change we took the
chance to make the section hardware independent. As the firmware
version we display the bios version if available on non XO
hardware. As ethtool has become a depedency of Sugar we can now

 ^ dependency


display the wireless firmware as well on all hardwares.


There's no plural form of hardware. Maybe "any hardware"?
Not that important, though.


The serial number is often only readable by root on non-XO
hardware. If the serial number can not be found on an XO we hide
that part of the section.

The patch has been tested on XO 1, 1.5, 1.75 and on a Thinkpad T61.


I like the general approach. Thanks for considering (and even testing
on) non-XO hardware!


[extensions/cpsection/aboutcomputer/model.py]

@@ -17,7 +17,6 @@

  import os
  import logging
-import re
  import subprocess
  from gettext import gettext as _
  import errno
@@ -35,6 +34,7 @@ _NM_DEVICE_TYPE_WIFI = 2

  _OFW_TREE = '/ofw'
  _PROC_TREE = '/proc/device-tree'
+_SYS_TREE = '/sys/class/dmi/id'


Both /ofw and /proc/device/tree are mount points for the OFW device
tree. /sys/class/dmi/id OTOH contains different entries. So
_DMI_DIRECTORY might be a better name.


Is fine with me, done.


@@ -58,6 +58,8 @@ def get_serial_number():
  serial_no = _read_file(os.path.join(_OFW_TREE, _SN))
  elif os.path.exists(os.path.join(_PROC_TREE, _SN)):
  serial_no = _read_file(os.path.join(_PROC_TREE, _SN))
+else:
+return None
  if serial_no is None:
  serial_no = _not_available
  return serial_no


We are hiding the serial number completely if the kernel doesn't expose
device tree information, but show "Not available" if the file couldn't
be read or parsed. That doesn't really match the patch description.

How about:

def get_serial_number():
 if os.path.exists(os.path.join(_OFW_TREE, _SN)):
 return _read_file(os.path.join(_OFW_TREE, _SN))
 elif os.path.exists(os.path.join(_PROC_TREE, _SN)):
 return _read_file(os.path.join(_PROC_TREE, _SN))
 elif os.path.exists(os.path.join(_DMI_DIRECTORY, 'board_serial'):
 return _read_file(os.path.join(_DMI_DIRECTORY, 'board_serial'))
 return None


Ahh, maybe not as clear from the description. The board_serial is only 
readable by root. Knowing that it does not really make sense to try to 
read it. That is why I special cased displaying the serial number. The 
behavior has not changed to previous code, so I think it is good like 
that, espacially as a bug fix patch.



@@ -100,14 +102,14 @@ def get_firmware_number():
  firmware_no = None
  if os.path.exists(os.path.join(_OFW_TREE, _MODEL)):
  firmware_no = _read_file(os.path.join(_OFW_TREE, _MODEL))
+firmware_no = firmware_no[6:13]
  elif os.path.exists(os.path.join(_PROC_TREE, _MODEL)):
  firmware_no = _read_file(os.path.join(_PROC_TREE, _MODEL))
+firmware_no = firmware_no[6:13]
+elif os.path.exists(os.path.join(_SYS_TREE, 'bios_version')):
+firmware_no = _read_file(os.path.join(_SYS_TREE, 'bios_version'))


The above assumes OLPC format (e.g. "CL2   Q4B11  Q4B") for
.../openprom/model and will break on other machines with device tree
(e.g. PPC Macs). The old code at least only did the cutting if there
actually were three space-separated parts:


Ok, will revert to old format.


  if firmware_no is None:
  firmware_no = _not_available
-else:
-firmware_no = re.split(' +', firmware_no)
-if len(firmware_no) == 3:
-firmware_no = firmware_no[1]
  return firmware_no



[extensions/cpsection/aboutcomputer/view.py]

@@ -127,37 +128,36 @@ class AboutComputer(SectionView):
  box_software.pack_start(box_sugar, expand=False)
  box_sugar.show()

-if os.path.exists('/ofw'):


I wonder if we should hide the Firmware version if it's unavailable,
like we now do for the serial number. Is it useful to know that Sugar
would display it, but can't access it? Could it confuse users if it
doesn't get mentioned at all?

Sascha



In general, I prefer the approach to show the same items all the time 
and disable them or mark them as not available like we do in the rest of 
the UI a lot (e.g. with buttons).


For the future I would as well always show the identity section, with 
the model and the serial number marked as unreadable/not available.


Regards,
   Simon
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH 2/2] Only activate keyboard configuration if it was configured, OLPC #11175

2011-10-09 Thread Simon Schampijer

On 10/06/2011 04:59 PM, Daniel Drake wrote:

Sugar is currently activing a new keyboard config even if the user
did not change any settings.


Looks good.


Avoid this by only activating the configuration if user-specified
settings are found in gconf. Also remove the default 'evdev' model
string so that gconf settings are truly blank unless the user has
selected something.


Hmm, the original bug that git fixed by that was #1717 [1] from the 
description: "Since we do not supply a keyboard model by default, 
xfree86 gets picked up, and as a result the arrow keys, etc do not work 
on Xephyr. We should use evdev instead."


However with or without your patches the arrow keys do not work for me 
on Xephyr (jhbuild F14). Not sure if that was ever fixed at all...


Regards,
   Simon

[1] http://bugs.sugarlabs.org/ticket/1717
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH 1/2] Fix presence detection of keyboard layouts/options

2011-10-09 Thread Simon Schampijer

On 10/06/2011 04:58 PM, Daniel Drake wrote:

"foo is []" is not a valid way of checking if a list is empty
as this code intends.

"foo" alone as a boolean operator is an equivalent length check,
and also serves as a "is not None" check too.
---
  bin/sugar-session |5 ++---
  1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/bin/sugar-session b/bin/sugar-session
index 4b714c3..a0ec14f 100755
--- a/bin/sugar-session
+++ b/bin/sugar-session
@@ -147,8 +147,7 @@ def setup_keyboard_cb():
  layouts_list.append(layout.split('(')[0])
  variants_list.append(layout.split('(')[1][:-1])

-if layouts_list is not None and layouts_list is not [] \
-and variants_list is not None and variants_list is not []:
+if layouts_list and variants_list:


From the pep8 this is the right way of checking if a list is empty [1]. 
Might be worth referencing in the commit message. "For sequences, 
(strings, lists, tuples), use the fact that empty sequences are false."


The check if the list is None is surprising as well actually, as the 
list should never be None.



  configrec.set_layouts(layouts_list)
  configrec.set_variants(variants_list)

@@ -159,7 +158,7 @@ def setup_keyboard_cb():

  options = gconf_client.get_list(\
  '/desktop/sugar/peripherals/keyboard/options', gconf.VALUE_STRING)
-if options is not [] and options is not None:
+if options:
  configrec.set_options(options)

  configrec.activate(engine)


Patch looks good, acked as well by me.

Regards,
   Simon

[1] http://www.python.org/dev/peps/pep-0008/
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel