#NEWLINE# def installed( name , enabled = True ) : #NEWLINE# #INDENT# '\n    Make sure that we have the given bundle ID or path to command\n    installed in the assistive access panel.\n\n    name\n        The bundle ID or path to command\n\n    enable\n        Should assistive access be enabled on this application?\n\n    ' #NEWLINE# ret = { #NEWLINE# #INDENT# 'name' : name , #NEWLINE# 'result' : True , #NEWLINE# 'comment' : '' , #NEWLINE# 'changes' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# is_installed = __salt__ [ 'assistive.installed' ] ( name ) #NEWLINE# if is_installed : #NEWLINE# #INDENT# is_enabled = __salt__ [ 'assistive.enabled' ] ( name ) #NEWLINE# if ( enabled != is_enabled ) : #NEWLINE# #INDENT# __salt__ [ 'assistive.enable' ] ( name , enabled ) #NEWLINE# ret [ 'comment' ] = 'Updated enable to {0}' . format ( enabled ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ret [ 'comment' ] = 'Already in the correct state' #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# __salt__ [ 'assistive.install' ] ( name , enabled ) #NEWLINE# ret [ 'comment' ] = 'Installed {0} into the assistive access panel' . format ( name ) #NEWLINE# #UNINDENT# return ret