コード例 #1
0
ファイル: client.py プロジェクト: campadrenalin/libhalp
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
ファイル: client.py プロジェクト: campadrenalin/libhalp
def do_bcast(args):
	downloader = halp.Downloader()
	print downloader.bcast_insert(args.label, args.hostname, args.port,
		args.number, halp.posixnow()-args.seconds)