Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/system/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/system/gconftool2.pyc

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZdefd
��YZ
d�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys<
module: gconftool2
author:
    - Kenneth D. Evensen (@kevensen)
short_description: Edit GNOME Configurations
description:
  - This module allows for the manipulation of GNOME 2 Configuration via
    gconftool-2.  Please see the gconftool-2(1) man pages for more details.
version_added: "2.3"
options:
  key:
    description:
    - A GConf preference key is an element in the GConf repository
      that corresponds to an application preference. See man gconftool-2(1)
    required: yes
  value:
    description:
    - Preference keys typically have simple values such as strings,
      integers, or lists of strings and integers. This is ignored if the state
      is "get". See man gconftool-2(1)
  value_type:
    description:
    - The type of value being set. This is ignored if the state is "get".
    choices: [ bool, float, int, string ]
  state:
    description:
    - The action to take upon the key/value.
    required: yes
    choices: [ absent, get, present ]
  config_source:
    description:
    - Specify a configuration source to use rather than the default path.
      See man gconftool-2(1)
  direct:
    description:
    - Access the config database directly, bypassing server.  If direct is
      specified then the config_source must be specified as well.
      See man gconftool-2(1)
    type: bool
    default: 'no'
s�
- name: Change the widget font to "Serif 12"
  gconftool2:
    key: "/desktop/gnome/interface/font_name"
    value_type: "string"
    value: "Serif 12"
s�
  key:
    description: The key specified in the module parameters
    returned: success
    type: str
    sample: /desktop/gnome/interface/font_name
  value_type:
    description: The type of the value that was changed
    returned: success
    type: str
    sample: string
  value:
    description: The value of the preference key after executing the module
    returned: success
    type: str
    sample: "Serif 12"
...
(t
AnsibleModuletGConf2PreferencecB`s,eZedd�Zd�Zed�ZRS(tcC`s:||_||_||_||_||_||_dS(N(tansibletkeyt
value_typetvaluet
config_sourcetdirect(tselfRRR
RRR((sE/usr/lib/python2.7/site-packages/ansible/modules/system/gconftool2.pyt__init__Xs					cC`stS(N(tFalse(R((sE/usr/lib/python2.7/site-packages/ansible/modules/system/gconftool2.pytvalue_already_setasc	C`s�d}d}t}d}|jdk	rLt|j�dkrLd|j}n|jr^d}nd}y�|dkr�|dj|j�7}n_|dkr�|d	j|||j||j|j�7}n%|d
kr�|dj|j�7}n|j	j
|dt�\}}}	t|	�dkrG|rM|j	jd
dt
|	��qMnt}Wn*tk
rz}
|j	jd
d|
�nX||j�fS(s3 Helper function to perform gconftool-2 operations R
is--config-source s--directsgconftool-2 tgets	--get {0}tsets"{0} {1} --type {2} --{3} {4} "{5}"tunsets--unset {0}tuse_unsafe_shelltmsgs!gconftool-2 failed with error: %ss%gconftool-2 failed with exception: %sN(RRtNonetlenRtformatRR
RRtrun_commandtTruet	fail_jsontstrtOSErrortrstrip(Rt	call_typet
fail_onerrRRtchangedtouttcmdtrcterrt	exception((sE/usr/lib/python2.7/site-packages/ansible/modules/system/gconftool2.pytcallds>$		!
(t__name__t
__module__RRRRR+(((sE/usr/lib/python2.7/site-packages/ansible/modules/system/gconftool2.pyR	Ws	cC`s�tdtdtdddt�dtddddd	d
dg�dtdd�d
tdddtddddg�dtdddt�dtdd��dt�}idd6dd6dd6}|jd}|jd}|jdj�dkr�d}n)|jddkrd}n
|jd}||jd
}|jd}|jd}t}d}	|dkr(|dks�|dkr�|jddt|��n5|dks�|dkr�|jddt|��n|r�|dkr�|jddd�q(|r(|dk	r(|jddd �q(nt	||||||�}
|
j
dd!t�\}}||kr�|jr�t}|}	q�|
j
|�\}}	n|}	td"i|d#6|d6|d6|	d$6|d%6|jdd&6�}
|jd#|d'|
�dS((Nt
argument_specRttypeR trequiredR
tchoicestbooltfloattinttstringRtstatetabsentRtpresentRtdefaultRtsupports_check_modeRRttruetfalseR
Rs#State %s requires "value" to be sets(State %s requires "value_type" to be setsIf "direct" is "yes" then the s!"config_source" must be specifieds$If the "config_source" is specified sthen "direct" must be "yes"R$t
gconftool2R%t	new_valuetprevious_valuetplaybook_valuet
ansible_facts(
RtdictRRtparamstlowerRRR R	R+t
check_modet	exit_json(tmoduletstate_valuesRR
RR6RRtchangeR>t
gconf_preft_t
current_valuetfacts((sE/usr/lib/python2.7/site-packages/ansible/modules/system/gconftool2.pytmain�sf!$	

		


		t__main__N(t
__future__RRRR/t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicRtobjectR	RNR,(((sE/usr/lib/python2.7/site-packages/ansible/modules/system/gconftool2.pyt<module>s


*?	R

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]