Mailinglist Archive: opensuse-buildservice (199 mails)

< Previous Next >
[opensuse-buildservice] Re: [opensuse-project] [gsoc] osc code cleanup - summary of week 2
On Saturday 04 June 2011 00:56:24 Marcus Hüwe wrote:

here's a small summary of the 2nd (coding) week. This
week I spent most of my time with working on an OO-style class
for doing http requests:
* it's possible to switch the http(s) implementation without touching any
library code
* supports response validation (if a schema was specified for the request)
I've looked at the code and tests and like it. As far as I have seen, you
included a 'directory' schema from the OBS. At some point in time we may
either want to move schemas into a shared module or move osc2 back into the
OBS repo.

Currently I'm still working on the "remote models":
* decided to use lxml.objectify [1]:
- goal is to encapsulate the xml logic solely into the object itself
- example workflow:
prj = RemoteProject('some_name')
prj.title = 'dummy'
prj.description = 'foo bar'
repo = prj.add_repository(name='openSUSE_Factory')
repo.add_path(project='openSUSE:Factory', repository='standard')
# change arch to x86_64
repo.arch[0] = 'x86_64'
Good choice, this will greatly reduce the need for XML parsing, does
lxml.objectify allow validation when you create an object from a XML string?

Minor stuff:
* decided to use the "logging" module:
this way we can easily add "debug" and "info" etc. messages and it's up
to the "client" which messages it wants to display (I'm not talking about
the messages which are displayed when "osc up" is called or something like
Natural choice, I've seen you used it already in the httprequest module.
Mit freundlichen Grüßen,
Sascha Peilicke
< Previous Next >
Follow Ups