Need the help on hack gDesklets to kill the 'Linuxish' in Python.

Alexander Leidinger Alexander at Leidinger.net
Sun Sep 14 04:13:51 PDT 2003


On Sat, 13 Sep 2003 16:14:32 -0500
Jeremy Messenger <mezz7 at cox.net> wrote:

> Ok, I have tested them and they don't patch correct, so here's attaches of 
> cleaned patches.. I cleaned very few mistyped too. :-) I have tried to run 
> it with the SysInfo and I keep get this..
> 
> ==============================
> Traceback (most recent call last):
>    File "/usr/X11R6/share/gnome/gdesklets/factory/SensorFactory.py", line 
> 55, in create_sensor
>      module = __import__(name)
>    File "./SysInfo/__init__.py", line 5, in ?
>      import libdesklets as lib
>    File "/usr/X11R6/share/gnome/gdesklets/libdesklets/__init__.py", line 
> 56, in ?    cpu = CPU()
>    File "/usr/X11R6/share/gnome/gdesklets/libdesklets/CPU.py", line 25, in 
> __init__
>      os = lib.sys.get_os()
> AttributeError: 'module' object has no attribute 'sys'
> 'module' object has no attribute 'sys'
> ==============================
> 
> I tried to add the 'import sys' and it still doesn't work.. I am not sure 
> what to do with the 'lib.sys.get_os()', which I normal use 'sys.platform' 
> for OS stuff.

"import sys" is wrong, libdesklets has a "sys"-part too. I haven't
tested it, but I think it would be enough to put the "sys = Sys()" line
in /usr/X11R6/share/gnome/gdesklets/libdesklets/__init__.py in front of
every other assignment (if sys doesn't use a function of those other
parts; if it does, we have to change the OS detection to use the python
way (sys.platform)).

I haven't send this to bugzilla yet, as it isn't tested. When it runs
flawlessly, I'm OK with submitting it.

Bye,
Alexander.

-- 
            Yes, I've heard of "decaf." What's your point?

http://www.Leidinger.net                       Alexander @ Leidinger.net
  GPG fingerprint = C518 BC70 E67F 143F BE91  3365 79E2 9C60 B006 3FE7


More information about the freebsd-gnome mailing list