Re: [python-win32] wmi query error

2009-10-21 Thread Tim Golden
Nick Moszer wrote: Hello, I'm occasionally receiving the following error when doing a set of queries: Traceback (most recent call last): File psg5220_demo.py, line 236, in find_hdd_drives partitions = services.query(query) File ...path..\wmi.py, line 889, in query return [

Re: [python-win32] wmi query error

2009-10-21 Thread Nick Moszer
To make talking about it easier, I've slightly reworked your code to make it run completely (ie I've added imports and the initialisation of the data structures) and to take advantage of the wmi module's built-in features. Hopefully it's perfectly clear what's going on; I've just avoided

[python-win32] wmi query error

2009-10-20 Thread Nick Moszer
Hello, I'm occasionally receiving the following error when doing a set of queries: Traceback (most recent call last): File psg5220_demo.py, line 236, in find_hdd_drives partitions = services.query(query) File ...path..\wmi.py, line 889, in query return [ _wmi_object (obj, instance_of,

[python-win32] wmi query error

2009-10-20 Thread Nick Moszer
Hello, I'm occasionally receiving the following error when doing a set of queries: Traceback (most recent call last): File psg5220_demo.py, line 236, in find_hdd_drives partitions = services.query(query) File ...path..\wmi.py, line 889, in query return [ _wmi_object (obj, instance_of,

Re: [python-win32] wmi query.

2008-03-26 Thread mark.a.brand
lovely, thanks again. On 26/03/2008, Tim Golden [EMAIL PROTECTED] wrote: mark.a.brand wrote: what about events, for example i only want to return error and warning events for the last 4 days from all logs. getting all the events and then filtering them will be terrribly slow.

Re: [python-win32] wmi query.

2008-03-25 Thread Tim Golden
Tim Golden wrote: [... snip other examples ...] Even that is a slight optimisation. It usually costs little to pull back all the fields, so I generally write: code import wmi c = wmi.WMI () for service in c.Win32_Service (state=Stopped): print c.Caption, c.Status /code Sorry.

[python-win32] wmi query.

2008-03-24 Thread mark.a.brand
hi: how do you incorporate a where clause and selected field clause in a wmi query ? this gets me caption and state fields for all services c = wmi.WMI() for service in c.Win32_Service (['Caption', 'State']) ... this gets me all fields for stopped services c = wmi.WMI() for service in

Re: [python-win32] wmi query.

2008-03-24 Thread Tim Golden
mark.a.brand wrote: hi: how do you incorporate a where clause and selected field clause in a wmi query ? this gets me caption and state fields for all services c = wmi.WMI() for service in c.Win32_Service (['Caption', 'State']) ... this gets me all fields for stopped

Re: [python-win32] wmi query.

2008-03-24 Thread Tim Golden
mark.a.brand wrote: hi: how do you incorporate a where clause and selected field clause in a wmi query ? this gets me caption and state fields for all services c = wmi.WMI() for service in c.Win32_Service (['Caption', 'State']) ... this gets me all fields for stopped

Re: [python-win32] wmi query.

2008-03-24 Thread Tim Golden
mark.a.brand wrote: hi: how do you incorporate a where clause and selected field clause in a wmi query ? this gets me caption and state fields for all services c = wmi.WMI() for service in c.Win32_Service (['Caption', 'State']) ... this gets me all fields for stopped