import xmlrpclib import time class MacrolanClient: def startup(self,options): if options["controlled"]: self.register_local_key() #def startup def register_local_key(self): c=xmlrpclib.ServerProxy("https://IP:9779") f=open("/etc/n4d/key") key=f.readline().strip("\n") f.close() for x in range(0,4): try: c.register_key("","MacrolanServer","",key) return True except: time.sleep(5) #def register_key