#NEWLINE# def create_item( f , filename , size , content_type , content_type_hint , maxlife_stamp = FOREVER ) : #NEWLINE# #INDENT# '\n    create an item from open file <f> with the given metadata, return the item name.\n    ' #NEWLINE# name = ItemName . create ( current_app . storage ) #NEWLINE# with current_app . storage . create ( name , size ) as item : #NEWLINE# #INDENT# ( size_written , file_hash ) = Upload . data ( item , f , size ) #NEWLINE# Upload . meta_new ( item , size , filename , content_type , content_type_hint , name , maxlife_stamp = maxlife_stamp ) #NEWLINE# Upload . meta_complete ( item , file_hash ) #NEWLINE# #UNINDENT# return content_type_hint