I haveb't look at the code in depth, but have you thought about using
the apt python bindings instead of command line calls ("apt-get install
--assume-yes" is a bad idea)? aptsources even provides an abstraction of
the sources.list.
Cheers,
Sebastian