Example #1
0
def updateApplication(app, config):
    factory = AptProxyFactory()
    aptProxyFactoryConfig(factory)
    app = Application("AptProxy")
    app.listenTCP(factory.proxy_port, factory)
Example #2
0
def updateApplication(app, config):
    factory = AptProxyFactory()
    aptProxyFactoryConfig(factory)
    app = Application("AptProxy")
    app.listenTCP(factory.proxy_port, factory)
Example #3
0
                # print "URI: ", uri
                if not self.factory.access_times.has_key(uri):
                    log.msg("Adopting new file: " + uri, "recycle")
                    self.factory.access_times[uri] = os.path.getatime(path)
            else:
                log.msg("UNKNOWN:" + path, "recycle")

        if not self.pending:
            self.pop()
        if self.working:
            reactor.callLater(self.timer, self.process)


if __name__ == "__main__":
    # Just for testing purposes.
    from apt_proxy_conf import aptProxyFactoryConfig
    import shelve

    class DummyFactory:
        pass

    factory = DummyFactory()
    aptProxyFactoryConfig(factory)
    factory.access_times = shelve.open("tmp.db")
    recycle = MirrorRecycler(factory, 10)
    recycle.start()
    while recycle.working:
        recycle.process()

    factory.access_times.close()
Example #4
0
                #print "URI: ", uri
                if not self.factory.access_times.has_key(uri):
                    log.msg("Adopting new file: " + uri, 'recycle')
                    self.factory.access_times[uri] = os.path.getatime(path)
            else:
                log.msg("UNKNOWN:" + path, 'recycle')

        if not self.pending:
            self.pop()
        if self.working:
            reactor.callLater(self.timer, self.process)


if __name__ == '__main__':
    #Just for testing purposes.
    from apt_proxy_conf import aptProxyFactoryConfig
    import shelve

    class DummyFactory:
        pass

    factory = DummyFactory()
    aptProxyFactoryConfig(factory)
    factory.access_times = shelve.open("tmp.db")
    recycle = MirrorRecycler(factory, 10)
    recycle.start()
    while recycle.working:
        recycle.process()

    factory.access_times.close()