[python-win32] advice on architecting or program design in python:

mark.a.brand mark.a.brand at gmail.com
Tue Mar 11 03:16:37 CET 2008


i am new to python and wish but am writing a program as both a learning
experience and which may even get used if it is any good.

purpose of this program:
is to retrieve and store (for historical purposes) system-info for multiple
clients about multiple windows servers using tim golden's
wmi<http://tgolden.sc.sabren.com/python/wmi.html>wrapper. broadly the
algorithm is something like this.

for each client
    for each server
        write-system-info (to-a-db)

a call to any of these Win32_* classes returns a list of 1..n instances
which have a varying number of attributes. eg Win32_Process will have
attributes about processes, and Win32_Service() will have attributes about

i'am pretty sure i will need to have a seperate table for each server
component (eg a services table which contains historical info about
services, and a process table which contains historical info about

but is appears to me there is there is a lot of duplication as each class
always returns a list of instances - the only thing  different is the name
of the class (eg. Win32_Service() as opposed to Win32_Process()) and the
attributes returned by those classes.

so the things i am confused about:
* what would be an appropriate class structure
* is it possible to wrap somehow all the calls to the different Win32
classes and then do something with each different set of attributes that are

apologies - if this request seems vague, i can illuminate if asked specific

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-win32/attachments/20080311/6777b21c/attachment.htm 

More information about the python-win32 mailing list