On Thu, Aug 16, 2007 at 10:43:27AM -0300, James Oakley wrote:
I am also interested in feedback about friendlyness of using the osc module from external scripts.
It works great, in my experience. This isn't the first script I've written with it.
The initialisation isn't as intuitive as it could be, however:
conf.get_config() conf.config['apiurl'] = conf.config['scheme'] + '://' + conf.config['apisrv'] conf.config['user'] = conf.config['auth_dict'][conf.config['apisrv']]['user'] conf.init_basicauth(conf.config)
It would be nicer if there was one function to call, eg:
conf.init(apisrv=None)
where the default api server will be used if apisrv is None.
Thanks for the suggestion. I had something like that in mind, but deferred it until I replace the dictionary-based configuration with a more object-based approach. However, I just looked at the initialization code and it turned out that it was easier to integrate into get_config() than I thought. The function prototype now is: get_config(override_conffile = None, override_http_debug = None, override_apisrv = None) Please let me know if it works for you in the way you suggested. Thanks, Peter -- "WARNING: This bug is visible to non-employees. Please be respectful!" SUSE LINUX Products GmbH Research & Development