#NEWLINE# def save_sidebar( content ) : #NEWLINE# #INDENT# filepath = current_app . config . get ( 'SITE_SIDEBAR' ) #NEWLINE# if ( not filepath ) : #NEWLINE# #INDENT# flash ( 'Config your site with SITE_SIDEBAR' , 'warn' ) #NEWLINE# return #NEWLINE# #UNINDENT# dirname = os . path . dirname ( filepath ) #NEWLINE# if ( not os . path . exists ( dirname ) ) : #NEWLINE# #INDENT# os . makdirs ( dirname ) #NEWLINE# #UNINDENT# with open ( filepath , 'wb' ) as f : #NEWLINE# #INDENT# content = content . encode ( 'utf-8' ) #NEWLINE# f . write ( content )