def do_insert(args): cache = halp.Cache() label = cache.get(args.label) mytimestamp = halp.posixnow() - args.seconds mytime = datetime.datetime.utcfromtimestamp(mytimestamp) label.set((args.hostname, args.port), mytime) label.save() print "'%s %d' inserted to local cache under label '%s'" % (args.hostname, args.port, args.label) print "Timestamp", mytimestamp
def do_insert(args): cache = halp.Cache() label = cache.get(args.label) mytimestamp = halp.posixnow() - args.seconds mytime = datetime.datetime.utcfromtimestamp(mytimestamp) label.set((args.hostname, args.port), mytime) label.save() print "'%s %d' inserted to local cache under label '%s'" % ( args.hostname, args.port, args.label) print "Timestamp", mytimestamp
def do_bcast(args): downloader = halp.Downloader() print downloader.bcast_insert(args.label, args.hostname, args.port, args.number, halp.posixnow() - args.seconds)
def do_bcast(args): downloader = halp.Downloader() print downloader.bcast_insert(args.label, args.hostname, args.port, args.number, halp.posixnow()-args.seconds)