On Feb 1, 12:38 am, "Hendrik van Rooyen" <m...@microcorp.co.za> wrote: > "flagg" <iana.....@gmail.com> wrote: > >Let me see if i can elaborate on the requirements. I have 20+ > >different zone files. I want the xmlrpc server to be able to > >determine what zone file to open by looking at the incoming xml > >request. For example one of the functions I have now is to show a DNS > >record (I am using dnspython for most of this work) > > This is a wrong move, it is too magical - see below > > >If i send an xmlrpc request that uses the 'showRecord' function with > >params of 'oracle1.foo.bar.com' I want to parse the "params" piece > >and then instruct the xml-rpc server to open foo.bar.com.zone for > >reading. The reason why i was looking at do_Post() and _dispatch was > >to attempt to read the incoming params and do exactly that. > > >Do you think there is an easier way of accomplishing this, than the > >way I am going about it? > > Yes I do. > > Why don't you split the functionality into two bits - exactly as if you were > doing > it locally: > > - OpenTheThing(whatOrWhere) > - ReadTheRecordAndShowIt(PossiblyWhichRecord) > > If it's a remote database you are accessing, then you may need even more > steps, like first doing some select, or whatever - I would get it running > locally, calling local functions directly on the server, and then make them > remote xmlrpc proxy functions, after it's all working. > > If you are getting the request from some user input, you can either change > the way you ask the questions, or you do the parsing at point of origen, to > determine what to call, in which sequence. > > - Hendrik
Actually I have it working as local functions, its wrapping those local functions up in a way that makes sense that is throwing me off. Your suggestion of making two functions one for opening the file and one for showing records makes sense. I will give it a shot -- http://mail.python.org/mailman/listinfo/python-list