* Issue reading files under /proc/acpi using python.
@ 2003-02-06 11:45 Srihari Vijayaraghavan
2003-02-06 11:59 ` Chmouel Boudjnah
[not found] ` <200302062245.44847.harisri-bzGI/hKkdgRBDgjK7y7TUQ@public.gmane.org>
0 siblings, 2 replies; 11+ messages in thread
From: Srihari Vijayaraghavan @ 2003-02-06 11:45 UTC (permalink / raw)
To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
Hello,
While I can read /proc/acpi files fine using 'cat', python is unable to read
files under that directory.
Here is how you can reproduce the issue:
$ cat /proc/acpi/battery/BAT0/info
present: yes
design capacity: 65120 mWh
last full capacity: 61627 mWh
battery technology: rechargeable
design voltage: 14800 mV
design capacity warning: 6156 mWh
design capacity low: 0 mWh
capacity granularity 1: 1480 mWh
capacity granularity 2: 1480 mWh
model number: 4000
serial number: 1
battery type:
OEM info: COMPAQ
$
$ cat /proc/version
Linux version 2.4.21-pre4-acpi (hari-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org) (gcc version 3.2
20020903 (Red Hat Linux 8.0 3.2-7)) #1 Thu Feb 6 00:12:06 EST 2003
$
$ python
Python 2.2.1 (#1, Aug 30 2002, 12:15:30)
[GCC 3.2 20020822 (Red Hat Linux Rawhide 3.2-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> file("/proc/acpi/battery/BATO/info").read()
Traceback (most recent call last):
File "<stdin>", line 1, in ?
IOError: [Errno 2] No such file or directory: '/proc/acpi/battery/BATO/info'
>>> file("/proc/version").read()
'Linux version 2.4.21-pre4-acpi (hari-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org) (gcc version 3.2
20020903 (Red Hat Linux 8.0 3.2-7)) #1 Thu Feb 6 00:12:06 EST 2003\n'
>>>
Softwares involved:
Kernel: Linux-2.4.21-pre4 + acpi-20030125-2.4.21-pre3.diff.gz
Rest all as in Red Hat 8.0 (with official updates)
(BTW same behavior is observed with Red Hat beta 8.1, which has updated
versions of gcc, glibc, python etc..)
It will be great if I can read all the ascii text files under /proc/acpi using
python, like /proc/cpuinfo, /proc/meminfo, /proc/version etc.. files.
Thanks
--
Hari
harisri-bzGI/hKkdgRBDgjK7y7TUQ@public.gmane.org
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Issue reading files under /proc/acpi using python.
2003-02-06 11:45 Issue reading files under /proc/acpi using python Srihari Vijayaraghavan
@ 2003-02-06 11:59 ` Chmouel Boudjnah
[not found] ` <200302062245.44847.harisri-bzGI/hKkdgRBDgjK7y7TUQ@public.gmane.org>
1 sibling, 0 replies; 11+ messages in thread
From: Chmouel Boudjnah @ 2003-02-06 11:59 UTC (permalink / raw)
To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
Srihari Vijayaraghavan <harisri=bzGI/hKkdgRBDgjK7y7TUQ@public.gmane.org> writes:
> $ python
> Python 2.2.1 (#1, Aug 30 2002, 12:15:30)
> [GCC 3.2 20020822 (Red Hat Linux Rawhide 3.2-4)] on linux2
i just tested with a 2.2.2 and it works flawless...
--
http://www.chmouel.com/
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Issue reading files under /proc/acpi using python.
[not found] ` <200302062245.44847.harisri-bzGI/hKkdgRBDgjK7y7TUQ@public.gmane.org>
@ 2003-02-06 12:30 ` Sergio Visinoni
[not found] ` <20030206133039.A10882-mRUH1VNo/yu/RHH9vPZxQGD2FQJk+8+b@public.gmane.org>
2003-02-06 13:49 ` Issue reading files under /proc/acpi using python Ducrot Bruno
1 sibling, 1 reply; 11+ messages in thread
From: Sergio Visinoni @ 2003-02-06 12:30 UTC (permalink / raw)
To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
* Srihari Vijayaraghavan (harisri-bzGI/hKkdgRBDgjK7y7TUQ@public.gmane.org) wrote:
> While I can read /proc/acpi files fine using 'cat', python is unable to read
> files under that directory.
>
> Here is how you can reproduce the issue:
>
> $ cat /proc/acpi/battery/BAT0/info
[snip]
> >>> file("/proc/acpi/battery/BATO/info").read()
> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> IOError: [Errno 2] No such file or directory: '/proc/acpi/battery/BATO/info'
> >>> file("/proc/version").read()
well BATO != BAT0... you're using a capital o (letter) instead of a 0 (number)
Greetings,
Sergio Visinoni
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Issue reading files under /proc/acpi using python.
[not found] ` <20030206133039.A10882-mRUH1VNo/yu/RHH9vPZxQGD2FQJk+8+b@public.gmane.org>
@ 2003-02-06 12:43 ` Srihari Vijayaraghavan
[not found] ` <200302062343.38789.harisri-bzGI/hKkdgRBDgjK7y7TUQ@public.gmane.org>
2003-02-06 13:51 ` truc pour les francophones sur la liste Stefan Behnel
1 sibling, 1 reply; 11+ messages in thread
From: Srihari Vijayaraghavan @ 2003-02-06 12:43 UTC (permalink / raw)
To: Sergio Visinoni
Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Chmouel Boudjnah
Hello Everyone,
On Thursday 06 February 2003 23:30, Sergio Visinoni wrote:
> [...]
> well BATO != BAT0... you're using a capital o (letter) instead of a 0
> (number)
> [...]
My mistake, I can't apologies enough. :)
I learned my lesson, I should not rely too heavily on bash's command
completion feature! (Had I typed the directory structure by hand at least
once, I would have known the difference between 0 (numeric) and O (alphabet)
)
Everything is fine.
Thanks everyone, and keep up your good work on Linux-ACPI.
--
Hari
harisri-bzGI/hKkdgRBDgjK7y7TUQ@public.gmane.org
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Issue reading files under /proc/acpi using python.
[not found] ` <200302062245.44847.harisri-bzGI/hKkdgRBDgjK7y7TUQ@public.gmane.org>
2003-02-06 12:30 ` Sergio Visinoni
@ 2003-02-06 13:49 ` Ducrot Bruno
1 sibling, 0 replies; 11+ messages in thread
From: Ducrot Bruno @ 2003-02-06 13:49 UTC (permalink / raw)
To: Srihari Vijayaraghavan; +Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
On Thu, Feb 06, 2003 at 10:45:44PM +1100, Srihari Vijayaraghavan wrote:
> Hello,
>
> While I can read /proc/acpi files fine using 'cat', python is unable to read
> files under that directory.
>
> Here is how you can reproduce the issue:
>
Don't know.
I have:
ducrot@novae:~$ python2.2
Python 2.2.1 (#1, Jul 29 2002, 23:15:49)
[GCC 2.95.4 20011002 (Debian prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> print file("/proc/acpi/battery/BAT1/state").read()
present: yes
capacity state: ok
charging state: unknown
present rate: 0 mA
remaining capacity: 2040 mAh
present voltage: 14800 mV
>>> print file("/proc/acpi/battery/BAT1/info").read()
present: yes
design capacity: 4000 mAh
last full capacity: 4000 mAh
battery technology: rechargeable
design voltage: 14800 mV
design capacity warning: 420 mAh
design capacity low: 156 mAh
capacity granularity 1: 264 mAh
capacity granularity 2: 3780 mAh
model number: PA3098U
serial number: 3658Q
battery type: Li-Ion
OEM info: TOSHIBA
>>> print file("/proc/version").read()
Linux version 2.4.21-pre3 (root@novae) (gcc version 2.95.4 (Debian prerelease)) #3 Tue Feb 4 16:30:11 CET 2003
>>>
ducrot@novae:~$ python2.2 -V
Python 2.2.1
libc 2.25.
Cheers,
--
Ducrot Bruno
-- Which is worse: ignorance or apathy?
-- Don't know. Don't care.
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
^ permalink raw reply [flat|nested] 11+ messages in thread
* truc pour les francophones sur la liste...
[not found] ` <20030206133039.A10882-mRUH1VNo/yu/RHH9vPZxQGD2FQJk+8+b@public.gmane.org>
2003-02-06 12:43 ` Srihari Vijayaraghavan
@ 2003-02-06 13:51 ` Stefan Behnel
[not found] ` <3E426861.900-8NdywcgfOMlWMvVl7B+zuCEWGD4kr0XT@public.gmane.org>
1 sibling, 1 reply; 11+ messages in thread
From: Stefan Behnel @ 2003-02-06 13:51 UTC (permalink / raw)
To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
Sergio Visinoni schrieb:
>>$ cat /proc/acpi/battery/BAT0/info
> [snip]
>>>>>file("/proc/acpi/battery/BATO/info").read()
>>IOError: [Errno 2] No such file or directory: '/proc/acpi/battery/BATO/info'
> well BATO != BAT0... you're using a capital o (letter) instead of a 0 (number)
Évidemment, c'est pas BATO! ;)
SCNR...
Stefan :)
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Issue reading files under /proc/acpi using python.
[not found] ` <200302062343.38789.harisri-bzGI/hKkdgRBDgjK7y7TUQ@public.gmane.org>
@ 2003-02-06 14:00 ` Ducrot Bruno
[not found] ` <20030206140059.GR1205-j6u/t2rXLliUoIHC/UFpr9i2O/JbrIOy@public.gmane.org>
0 siblings, 1 reply; 11+ messages in thread
From: Ducrot Bruno @ 2003-02-06 14:00 UTC (permalink / raw)
To: Srihari Vijayaraghavan
Cc: Sergio Visinoni, acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
Chmouel Boudjnah
On Thu, Feb 06, 2003 at 11:43:38PM +1100, Srihari Vijayaraghavan wrote:
> Hello Everyone,
>
> On Thursday 06 February 2003 23:30, Sergio Visinoni wrote:
> > [...]
> > well BATO != BAT0... you're using a capital o (letter) instead of a 0
> > (number)
> > [...]
>
> My mistake, I can't apologies enough. :)
>
> I learned my lesson, I should not rely too heavily on bash's command
> completion feature! (Had I typed the directory structure by hand at least
> once, I would have known the difference between 0 (numeric) and O (alphabet)
> )
>
BTW, you want to write a generic python acpi class, do you ?
--
Ducrot Bruno
-- Which is worse: ignorance or apathy?
-- Don't know. Don't care.
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: truc pour les francophones sur la liste...
[not found] ` <3E426861.900-8NdywcgfOMlWMvVl7B+zuCEWGD4kr0XT@public.gmane.org>
@ 2003-02-06 16:31 ` Ducrot Bruno
0 siblings, 0 replies; 11+ messages in thread
From: Ducrot Bruno @ 2003-02-06 16:31 UTC (permalink / raw)
To: Stefan Behnel; +Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
On Thu, Feb 06, 2003 at 02:51:29PM +0100, Stefan Behnel wrote:
>
>
> Sergio Visinoni schrieb:
> >>$ cat /proc/acpi/battery/BAT0/info
> >[snip]
> >>>>>file("/proc/acpi/battery/BATO/info").read()
> >>IOError: [Errno 2] No such file or directory:
> >>'/proc/acpi/battery/BATO/info'
>
> >well BATO != BAT0... you're using a capital o (letter) instead of a 0
> >(number)
>
> Évidemment, c'est pas BATO! ;)
>
Pas certain. "ACPI et OpenFirmware sont dans un BATO..."
--
Ducrot Bruno
-- Which is worse: ignorance or apathy?
-- Don't know. Don't care.
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Issue reading files under /proc/acpi using python.
[not found] ` <20030206140059.GR1205-j6u/t2rXLliUoIHC/UFpr9i2O/JbrIOy@public.gmane.org>
@ 2003-02-07 13:09 ` Srihari Vijayaraghavan
[not found] ` <200302080009.18002.harisri-bzGI/hKkdgRBDgjK7y7TUQ@public.gmane.org>
0 siblings, 1 reply; 11+ messages in thread
From: Srihari Vijayaraghavan @ 2003-02-07 13:09 UTC (permalink / raw)
To: Ducrot Bruno; +Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
Hello Ducrot,
On Friday 07 February 2003 01:00, Ducrot Bruno wrote:
> [...]
> BTW, you want to write a generic python acpi class, do you ?
While I am no python guru (not just yet), I hope to write a text based utility
(great if it is a GUI one) in python to display things like:
1. Battery charge remaining
2. AC adapter status
3. Thermal information
4. etc..
(In fact I have written a text based python utility to display some of those
by reading /proc/acpi files). I can send you that in a private e-mail if you
wish, it isn't complete yet though.
The real problem is KDE 3.0.x in RH 8.0 doesn't work with newer ACPI code, of
course I have verified that KDE 3.1 on Rh 8.1 Beta works fine however. I
guess I am lazy to find a utility in the internet that could do that under RH
8.0.
Anyway if you know of any open-source code in python that would help me,
please provide me an URL if you can.
Thanks for your help.
--
Hari
harisri-bzGI/hKkdgRBDgjK7y7TUQ@public.gmane.org
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Issue reading files under /proc/acpi using python.
[not found] ` <200302080009.18002.harisri-bzGI/hKkdgRBDgjK7y7TUQ@public.gmane.org>
@ 2003-02-07 14:46 ` Ducrot Bruno
2003-02-09 18:28 ` Axel Müller
1 sibling, 0 replies; 11+ messages in thread
From: Ducrot Bruno @ 2003-02-07 14:46 UTC (permalink / raw)
To: Srihari Vijayaraghavan
Cc: Ducrot Bruno, acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
On Sat, Feb 08, 2003 at 12:09:17AM +1100, Srihari Vijayaraghavan wrote:
> Hello Ducrot,
>
> On Friday 07 February 2003 01:00, Ducrot Bruno wrote:
> > [...]
> > BTW, you want to write a generic python acpi class, do you ?
>
> While I am no python guru (not just yet), I hope to write a text based utility
> (great if it is a GUI one) in python to display things like:
> 1. Battery charge remaining
> 2. AC adapter status
> 3. Thermal information
> 4. etc..
> (In fact I have written a text based python utility to display some of those
> by reading /proc/acpi files). I can send you that in a private e-mail if you
> wish, it isn't complete yet though.
Yep, if you can provide me some codes in Python in that area, I will be really
happy!
I am not a great python guru, though.
>
> The real problem is KDE 3.0.x in RH 8.0 doesn't work with newer ACPI code, of
> course I have verified that KDE 3.1 on Rh 8.1 Beta works fine however. I
> guess I am lazy to find a utility in the internet that could do that under RH
> 8.0.
>
> Anyway if you know of any open-source code in python that would help me,
> please provide me an URL if you can.
Well.. Sorry, I am not aware of such URL, but I guess it would be just fine
to have a generic acpi class under python (I don't have time to do it myself
at this time, even though I have some ideas on how to implement such
class).
Cheers,
--
Ducrot Bruno
-- Which is worse: ignorance or apathy?
-- Don't know. Don't care.
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Issue reading files under /proc/acpi using python.
[not found] ` <200302080009.18002.harisri-bzGI/hKkdgRBDgjK7y7TUQ@public.gmane.org>
2003-02-07 14:46 ` Ducrot Bruno
@ 2003-02-09 18:28 ` Axel Müller
1 sibling, 0 replies; 11+ messages in thread
From: Axel Müller @ 2003-02-09 18:28 UTC (permalink / raw)
To: Srihari Vijayaraghavan; +Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
Hello,
there exists a patch for the klaptopdaemon, which is in kdeutils-src.rpm on
Redhat 8.0 CD 5, you can get from the ACPI-Sourceforge-Homepage. It worked
well for me.
Axel
<-snip->
> The real problem is KDE 3.0.x in RH 8.0 doesn't work with newer ACPI
> code, of course I have verified that KDE 3.1 on Rh 8.1 Beta works fine
> however. I guess I am lazy to find a utility in the internet that could
> do that under RH 8.0.
>
<-snip->
--
Dipl.Phys. Axel Müller (axel.mueller-qenKrGB1/YlH8HOlP0F5JqhivhuVJJ3m@public.gmane.org)
Institut für Werkstoffe der Elektrotechnik IWE
Universität Karlsruhe
Tel. 0721/608-7569 Fax 0721/608-7492
http://www.iwe.uni-karlsruhe.de
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2003-02-09 18:28 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-06 11:45 Issue reading files under /proc/acpi using python Srihari Vijayaraghavan
2003-02-06 11:59 ` Chmouel Boudjnah
[not found] ` <200302062245.44847.harisri-bzGI/hKkdgRBDgjK7y7TUQ@public.gmane.org>
2003-02-06 12:30 ` Sergio Visinoni
[not found] ` <20030206133039.A10882-mRUH1VNo/yu/RHH9vPZxQGD2FQJk+8+b@public.gmane.org>
2003-02-06 12:43 ` Srihari Vijayaraghavan
[not found] ` <200302062343.38789.harisri-bzGI/hKkdgRBDgjK7y7TUQ@public.gmane.org>
2003-02-06 14:00 ` Ducrot Bruno
[not found] ` <20030206140059.GR1205-j6u/t2rXLliUoIHC/UFpr9i2O/JbrIOy@public.gmane.org>
2003-02-07 13:09 ` Srihari Vijayaraghavan
[not found] ` <200302080009.18002.harisri-bzGI/hKkdgRBDgjK7y7TUQ@public.gmane.org>
2003-02-07 14:46 ` Ducrot Bruno
2003-02-09 18:28 ` Axel Müller
2003-02-06 13:51 ` truc pour les francophones sur la liste Stefan Behnel
[not found] ` <3E426861.900-8NdywcgfOMlWMvVl7B+zuCEWGD4kr0XT@public.gmane.org>
2003-02-06 16:31 ` Ducrot Bruno
2003-02-06 13:49 ` Issue reading files under /proc/acpi using python Ducrot Bruno
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox