#!/usr/bin/python2.5 """ Copyright (C) 2008 Norman Messtorff This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. """ from TransportClient import TransportClient from ParseStatusfile import ParseStatusfile class ClientWorker(TransportClient, ParseStatusfile): """Worker on Client side""" def __init__(self): TransportClient.__init__(self) ParseStatusfile.__init__(self) self.register() if self.registered: self.debug(4, "Class ClientWorker initialized") else: self.debug(1, "Could not register to DebMan, please check the credentials!") def __del__(self): TransportClient.__del__(self) def run(self, filename="/var/lib/dpkg/status"): """Start parsing and transmit package informations to DebMan""" self.transmit_init() for pkg in self.getall(filename): self.transmit_append( (pkg[0], pkg[2], pkg[3], pkg[1]) ) # TODO: static content! self.transmit_exec("Debian", "etch", "main", "i386") return 0