#NEWLINE# def _save_permission( self , permission ) : #NEWLINE# #INDENT# 'save permission to file' #NEWLINE# try : #NEWLINE# #INDENT# config = parse_config ( self . resource , permission ) #NEWLINE# with codecs . open ( ex . permission_json , 'w' , encoding = 'utf-8' ) as f : #NEWLINE# #INDENT# json . dump ( permission , f , indent = 4 , ensure_ascii = False , sort_keys = True ) #NEWLINE# #UNINDENT# self . permission = permission #NEWLINE# self . config = config #NEWLINE# #UNINDENT# except IOError as ex : #NEWLINE# #INDENT# ex . strerror = ( "can't save permission to file: %s" % ex . strerror ) #NEWLINE# raise #NEWLINE# #UNINDENT# except AssertionError as ex : #NEWLINE# #INDENT# raise ValueError ( ex . message )