#NEWLINE# def get_logging( bhandle ) : #NEWLINE# #INDENT# logging = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# try : #NEWLINE# #INDENT# logging = bhandle . get_logging_status ( ) #NEWLINE# grants = [ ] #NEWLINE# if logging . grants : #NEWLINE# #INDENT# for grant in logging . grants : #NEWLINE# #INDENT# grant_dict = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# grant_dict [ 'permission' ] = grant . permission #NEWLINE# grant_dict [ 'type' ] = grant . type #NEWLINE# if ( grant . type == 'CanonicalUser' ) : #NEWLINE# #INDENT# grant_dict [ 'type' ] = 'CanonicalUser' #NEWLINE# grant_dict [ 'display_name' ] = grant . display_name #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( grant . type == 'Group' ) : #NEWLINE# #INDENT# grant_dict [ 'type' ] = 'Group' #NEWLINE# grant_dict [ 'group_uri' ] = grant . uri #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# grant_dict [ 'email' ] = grant . email_address #NEWLINE# #UNINDENT# #UNINDENT# grants . append ( logging ) #NEWLINE# #UNINDENT# #UNINDENT# if logging . target : #NEWLINE# #INDENT# logging = { #NEWLINE# #INDENT# 'enabled' : True , #NEWLINE# 'target' : logging . target , #NEWLINE# 'prefix' : ( logging . prefix or '' ) , #NEWLINE# 'grants' : grants , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# logging = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# #UNINDENT# except : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# return logging