Пример #1
0
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
Пример #2
0
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
Пример #3
0
def do_bcast(args):
    downloader = halp.Downloader()
    print downloader.bcast_insert(args.label, args.hostname, args.port,
                                  args.number,
                                  halp.posixnow() - args.seconds)
Пример #4
0
def do_bcast(args):
	downloader = halp.Downloader()
	print downloader.bcast_insert(args.label, args.hostname, args.port,
		args.number, halp.posixnow()-args.seconds)