About this computer

Denis Washington dwashington at gmx.net
Fri Dec 14 11:01:36 GMT 2007


On Fri, 2007-12-14 at 05:00 +0000, Ted Gould wrote:
> It needs to be cleaned up, but I'm currently more worried about
> correctness.  I don't need posts from everyone unless the values come
> out with something that is incorrect.  If everything is right don't
> worry about it.

If I run the script on my machine, I get this:

Processor:  AMD Athlon(tm) XP 2200+
HD size:  61492838400 bytes
Network:  VIA Technologies, Inc. :  VT6102 [Rhine-II]
Traceback (most recent call last):
  File "test.py", line 115, in <module>
    main()
  File "test.py", line 56, in main
    finalnode = xorgline.split('"')[1]
IndexError: list index out of range

This is because you don't seem to be skipping empty lines for xorg.conf,
which I have in my "Device" section. I fixed it like this in your
script:

if len(xorgline) == 0:
	continue

Also, note that Python strings are immutable: the call to strip()
returns the stripped version of the string, but doesn't touch the
original object. So:

xorgline.strip()

has to be:

xorgline = xorgline.strip()

I attached the script with the told changes to this mail. Besides that,
all information was gathered correctly for me.

Cheers,
Denis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.py
Type: text/x-python
Size: 3549 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/ubuntu-desktop/attachments/20071214/8f725277/attachment-0001.py 


More information about the ubuntu-desktop mailing list