#NEWLINE# def create_status( conn , uid , message , **data ) : #NEWLINE# #INDENT# pipeline = conn . pipeline ( True ) #NEWLINE# pipeline . hget ( ( 'user:%s' % uid ) , 'login' ) #NEWLINE# pipeline . incr ( 'status:id:' ) #NEWLINE# ( login , id ) = pipeline . execute ( ) #NEWLINE# if ( not login ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# data . update ( { #NEWLINE# #INDENT# 'message' : message , #NEWLINE# 'posted' : time . time ( ) , #NEWLINE# 'id' : id , #NEWLINE# 'uid' : uid , #NEWLINE# 'login' : login , #NEWLINE# #UNINDENT# } ) #NEWLINE# pipeline . hmset ( ( 'status:%s' % id ) , data ) #NEWLINE# pipeline . hincrby ( ( 'user:%s' % uid ) , 'posts' ) #NEWLINE# pipeline . execute ( ) #NEWLINE# return id