<s> '''<STR_LIT>''' <EOL> from __future__ import absolute_import <EOL> import logging <EOL> import re <EOL> log = logging . getLogger ( __name__ ) <EOL> def _check_current_value ( gnome_kwargs , value ) : <EOL> '''<STR_LIT>''' <EOL> current_value = __salt__ [ '<STR_LIT>' ] ( ** gnome_kwargs ) <EOL> return str ( current_value ) == str ( value ) <EOL> def _do ( name , gnome_kwargs , preferences ) : <EOL> '''<STR_LIT>''' <EOL> ret = { '<STR_LIT:name>' : name , <EOL> '<STR_LIT:result>' : True , <EOL> '<STR_LIT>' : { } , <EOL> '<STR_LIT>' : '<STR_LIT>' } <EOL> messages = [ ] <EOL> for pref in preferences : <EOL> key = pref <EOL> value = preferences [ pref ] <EOL> if isinstance ( value , bool ) : <EOL> ftype = '<STR_LIT>' <EOL> value = str ( value ) . lower ( ) <EOL> elif isinstance ( value , int ) : <EOL> ftype = '<STR_LIT:int>' <EOL> elif isinstance ( value , str ) : <EOL> ftype = '<STR_LIT:string>' <EOL> else : <EOL> ftype = '<STR_LIT:string>' <EOL> gnome_kwargs . update ( { '<STR_LIT:key>' : key , '<STR_LIT:value>' : value } ) <EOL> if _check_current_value ( gnome_kwargs , value ) : <EOL> messages . append ( '<STR_LIT>' . format ( key , value ) ) <EOL> else : <EOL> result = __salt__ [ '<STR_LIT>' ] ( ** gnome_kwargs ) <EOL> if result [ '<STR_LIT>' ] == <NUM_LIT:0> : <EOL> messages . append ( '<STR_LIT>' . format ( key , value ) ) <EOL> ret [ '<STR_LIT>' ] [ key ] = '<STR_LIT>' . format ( key , value ) <EOL> ret [ '<STR_LIT:result>' ] = True <EOL> else : <EOL> messages . append ( result [ '<STR_LIT>' ] ) <EOL> ret [ '<STR_LIT:result>' ] = False <EOL> ret [ '<STR_LIT>' ] = '<STR_LIT:U+002CU+0020>' . join ( messages ) <EOL> return ret <EOL> def wm_preferences ( name , <EOL> user = None , <EOL> action_double_click_titlebar = None , <EOL> action_middle_click_titlebar = None , <EOL> action_right_click_titlebar = None , <EOL> application_based = None , <EOL> audible_bell = None , <EOL> auto_raise = None , <EOL> auto_raise_delay = None , <EOL> button_layout = None , <EOL> disable_workarounds = None , <EOL> focus_mode = None , <EOL> focus_new_windows = None , <EOL> mouse_button_modifier = None , <EOL> num_workspaces = None , <EOL> raise_on_click = None , <EOL> resize_with_right_button = None , <EOL> theme = None , <EOL> titlebar_font = None , <EOL> titlebar_uses_system_font = None , <EOL> visual_bell = None , <EOL> visual_bell_type = None , <EOL> workspace_names = None , <EOL> ** kwargs ) : <EOL> '''<STR_LIT>''' <EOL> gnome_kwargs = { <EOL> '<STR_LIT:user>' : user , <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } <EOL> preferences = [ '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> preferences_hash = { } <EOL> for pref in preferences : <EOL> if pref in locals ( ) and locals ( ) [ pref ] is not None : <EOL> key = re . sub ( '<STR_LIT:_>' , '<STR_LIT:->' , pref ) <EOL> preferences_hash [ key ] = locals ( ) [ pref ] <EOL> return _do ( name , gnome_kwargs , preferences_hash ) <EOL> def desktop_lockdown ( name , <EOL> user = None , <EOL> disable_application_handlers = None , <EOL> disable_command_line = None , <EOL> disable_lock_screen = None , <EOL> disable_log_out = None , <EOL> disable_print_setup = None , <EOL> disable_printing = None , <EOL> disable_save_to_disk = None , <EOL> disable_user_switching = None , <EOL> user_administration_disabled = None , <EOL> ** kwargs ) : <EOL> '''<STR_LIT>''' <EOL> gnome_kwargs = { <EOL> '<STR_LIT:user>' : user , <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } <EOL> preferences = [ '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' ] <EOL> preferences_hash = { } <EOL> for pref in preferences : <EOL> if pref in locals ( ) and locals ( ) [ pref ] is not None : <EOL> key = re . sub ( '<STR_LIT:_>' , '<STR_LIT:->' , pref ) <EOL> preferences_hash [ key ] = locals ( ) [ pref ] <EOL> return _do ( name , gnome_kwargs , preferences_hash ) <EOL> def desktop_interface ( name , <EOL> user = None , <EOL> automatic_mnemonics = None , <EOL> buttons_have_icons = None , <EOL> can_change_accels = None , <EOL> clock_format = None , <EOL> clock_show_date = None , <EOL> clock_show_seconds = None , <EOL> cursor_blink = None , <EOL> cursor_blink_time = None , <EOL> cursor_blink_timeout = None , <EOL> cursor_size = None , <EOL> cursor_theme = None , <EOL> document_font_name = None , <EOL> enable_animations = None , <EOL> font_name = None , <EOL> gtk_color_palette = None , <EOL> gtk_color_scheme = None , <EOL> gtk_im_module = None , <EOL> gtk_im_preedit_style = None , <EOL> gtk_im_status_style = None , <EOL> gtk_key_theme = None , <EOL> gtk_theme = None , <EOL> gtk_timeout_initial = None , <EOL> gtk_timeout_repeat = None , <EOL> icon_theme = None , <EOL> menubar_accel = None , <EOL> menubar_detachable = None , <EOL> menus_have_icons = None , <EOL> menus_have_tearoff = None , <EOL> monospace_font_name = None , <EOL> show_input_method_menu = None , <EOL> show_unicode_menu = None , <EOL> text_scaling_factor = None , <EOL> toolbar_detachable = None , <EOL> toolbar_icons_size = None , <EOL> toolbar_style = None , <EOL> toolkit_accessibility = None , <EOL> ** kwargs ) : <EOL> '''<STR_LIT>''' <EOL> gnome_kwargs = { <EOL> '<STR_LIT:user>' : user , <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } <EOL> preferences = [ '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' ] <EOL> preferences_hash = { } <EOL> for pref in preferences : <EOL> if pref in locals ( ) and locals ( ) [ pref ] is not None : <EOL> key = re . sub ( '<STR_LIT:_>' , '<STR_LIT:->' , pref ) <EOL> preferences_hash [ key ] = locals ( ) [ pref ] <EOL> return _do ( name , gnome_kwargs , preferences_hash ) </s>
