Carlos: Where does one find the objxml module? I have looked on python.org and Google and can't find it.
Thanks in advance, Barry [EMAIL PROTECTED] 541-302-1107 ________________________ We who cut mere stones must always be envisioning cathedrals. -Quarry worker's creed > -----Original Message----- > Date: Thu, 1 Jun 2006 23:36:27 -0700 > From: "Carlos Daniel Ruvalcaba Valenzuela" <[EMAIL PROTECTED]> > Subject: Re: [Tutor] implementing config files > To: "Tracy R Reed" <[EMAIL PROTECTED]> > Cc: tutor@python.org > Message-ID: > <[EMAIL PROTECTED]> > Content-Type: text/plain; charset="iso-8859-1" > > Your could try to use XML files to store configuration files, I > already coded something like that, using expat parser and loading the > XML contents to objects and attributes, this is a sample code of how > works my module: > > Lets supouse we have this file config.xml with the following contents: > <?xml version="1.0" encoding="ISO-8859-1"?> > <config> > <connection> > <server>MySQL</server> > <host>localhost</host> > <port>21</port> > <user>username</user> > <passwd></passwd> > </connection> > </config> > > and in our code: > > from objxml import * > > fd = file('config.xml', 'r') > p = XMLParser(fd) > > root = p.Root > port = str(root.connection.port) > user = str(root.connection.username) > > All nodes are objects, converting them to strings gets you the > content, you can also access the atributes as normal object > attributes. > > This code can be useful for what you want, take a look. > > Regards > Carlos Daniel Ruvalcaba Valenzuela > > > On 6/1/06, Tracy R Reed <[EMAIL PROTECTED]> wrote: > > Hello all! > > > > I am writing some code to implement a bunch of passive checks for the > > nagios network monitoring system. <<snip>> > > > > -- > > Tracy R Reed http://ultraviolet.org > > A: Because we read from top to bottom, left to right > > Q: Why should I start my reply below the quoted text _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor