Re: System Information

2006-03-20 Thread [EMAIL PROTECTED]
Good news! I asked a buddy that runs osx, and he whipped up a script for you :) I understand it's not python, but it gets you close, you should be able to use popen or subprocess.call to complete this. function is_charger_plugged_in() { sleep 3; BATTINFO=`ioreg -l -w 0 | grep IO

Re: System Information

2006-03-19 Thread Serge Orlov
[EMAIL PROTECTED] wrote: > in the online-documentation for this and had no luck. I imagine it is > quite easy and may even be as simple as a boolean variable...? In general it's not so simple, since a computer can have many power sources. > All I want to be able to tell is whether or not my compu

Re: System Information

2006-03-19 Thread [EMAIL PROTECTED]
Oops -- just asked a buddy, osx doesn't have /proc But you could look into sysctl I'll boot up my laptop and check out if there is anything regarding the battery, but I suspect you should investigate sysctl -a | grep acpi -- http://mail.python.org/mailman/listinfo/python-list

Re: System Information

2006-03-19 Thread [EMAIL PROTECTED]
I'm not sure about osx, but I know linux uses a proc virtual filesystem. ( freebsd is probably closer, and it doesn't either but you can mount it via mount_linprocfs none /proc) But if you know if you have a proc file system, you can check it to see if you are under power... IE if I remember righ