#NEWLINE# def save( self , package , pipe = None ) : #NEWLINE# #INDENT# if ( pipe is None ) : #NEWLINE# #INDENT# pipe = self . db #NEWLINE# #UNINDENT# data = { #NEWLINE# #INDENT# 'name' : package . name , #NEWLINE# 'version' : package . version , #NEWLINE# 'filename' : package . filename , #NEWLINE# 'last_modified' : package . last_modified . strftime ( '%s.%f' ) , #NEWLINE# #UNINDENT# } #NEWLINE# for ( key , value ) in package . data . iteritems ( ) : #NEWLINE# #INDENT# data [ key ] = json . dumps ( value ) #NEWLINE# #UNINDENT# pipe . hmset ( self . redis_key ( package . filename ) , data ) #NEWLINE# pipe . sadd ( key . redis_set , package . name ) #NEWLINE# pipe . sadd ( self . redis_filename_set ( package . name ) , package . filename )