#! /usr/bin/env python # # $Id: pack_zope,v 1.1 2002/02/28 09:33:41 granbo Exp $ # # Copyright (C) 2000 phd2@email.com. All rights reserved. # __version__ = "$Revision: 1.1 $"[11:-2] username = "admin" password = "PASSWORD" # this is only example, of course zope = "http://church.uiah.fi/" import sys, urllib class NoGUI_URLopener(urllib.FancyURLopener): def __init__(self, username, password, *args): apply(urllib.FancyURLopener.__init__, (self,) + args) self.username = username self.password = password self.asked = 0 def prompt_user_passwd(self, host, realm): if self.asked: raise "Unauthorised" else: self.asked = 1 return self.username, self.password try: days = sys.argv[1] except: days = 7 if __name__ == '__main__': urllib._urlopener = NoGUI_URLopener(username, password) urllib.urlretrieve("%s/Control_Panel/Database/manage_pack?days:float=%s" % (zope, days)) # EOF